I have checked the rail timetables and it looks like a good 5.5 - 7 hour journey, departing around 15:00 and arriving late at night in Gdansk. While the train ride is doable, I am considering alternatives, say by bus. Thusfar, I have come across Polskibus.com, currently 35 PLN one way 6h10m ride departing Warsaw at 15:30.
I took that route not too long ago and it worked out well, when the train arrived, I took the taxi to the hotel-taxis usually wait for passengers at the station. My journey was closer to 5 hours.