From Gedser you can take a Ferry to Rostock. The ferry is operated by Scandlines and sails every 2-4 hours.
The trainstation in Gedser is only serviced by train 1-2 times per day so you have to be lucky to catch a train from here. Instead the busses are fare more regular.
However if you have some waiting time in Gedser the station is worth a visit because of its special apperance.