If you want to travel from Malaysia to Koh Tao, one of the best ways to get there is to take a train to the border station of Padang Besar, then take the night sleeper train from Padang Besar to Chumphon (the gateway to ferry services over to Koh Tao).
Train number 46 Departs Padang Besar at 17:00 Thai time (18:00 Malaysian time) - arriving at Chumphon Railway Station at 01:56 Thai time.
This train is an all second Class sleeper service so the only tickets you can buy are for sleeping berths.
If you want to take a cheaper train, you will first have to travel from Padang Besar to Hat Yai where there are more frequent departures for trains to Bangkok (stopping at Chumphon) with cheap seats and some cheaper sleeping berths.
To get from Padang Besar to Hat Yai you can take a Shuttle train or cross over the main road border and take a minivan or local bus to Hat Yai bus terminal.
Once you arrive at Chumphon train station you can easily walk into town to find accommodation or you can hang around the train station for a few hours until the first ferry departs to Koh Tao.
The ferries leave from ports located quite a distance from the station (you can't walk there - it is too far) so when you buy tickets for the ferry to Koh Tao, the price includes a pick up from the train station.
The KTM Padang Besar station is connected by long-distance ETS trains from places like Kuala Lumpur or for shorter trips you can take a cheap KTM Komuter train
To see the latest train timetables to Padang Besar, see the following links:
The train fare from Padang Besar to Chumpon is:
Upper Bed / Sleeping Berth = 707 Thai Baht
Lower Bed / Sleeping Berth = 797 Thai Baht
Upper Bed / Sleeping Berth = 609 Thai Baht
Lower Bed / Sleeping Berth = 699 Thai Baht
This night sleeper train is very busy (especially during the high-season) so you should always book your train tickets to Chumphon in advance.