yeah, i don't think that poland is part of the eurail countries, but you can buy a poland/germany pass if that's something you're interested in.
polish trains are CHEAP!!! especially when you figure in the fact that (my guess is) you will most likely be coming in with Euros/USD. Example - I take a train from Wroclaw to Zielona Gora often and it's 13zl for a 4 hour train ride. That's about $4 US.
I also have heard that there is a direct Berlin-Warsaw train. If there is, and that's what you want to take, you should prob book in Berlin. It may be a lot more expensive than taking Polish trains though as it's prob an InterCity train or something like that.
A quick look at www.pkp.pl
(the polish train site) -- from Zielona Gora (a large-ish town about 3hrs by train from Berlin, right by German border) -- There is a train leaving tomorrow with NO STOPS to Warsaw 15:05 -- 6hrs 22mins on one of the nicer trains (and some Polish trains are CRAP!) costs 52 zl for 2nd class (less than $20 US), or 1st class 76zl (about $25 US)
(link to english search on the pkp site) - you might want to have a look at a polish map and and see what's closer to the german border and easily accessible from berlin (but zielona gora is not a bad place to start as there are direct trains from berlin)
It would be my best guess that buying polish train tix within poland, locally, will be so much cheaper though and prob your best bet.
While you're in poland, you should check out wroclaw (thats where i am) or krakow, if you have any extra time :D