For those who would like to travel by train from Kuala Lumpur to Bangkok, there is a connection via Keretapi Tanah Melayu (KTMB) and Bangkok Train. From Kuala Lumpur, you need to purchase ticket from KL Sentral to Butterworth. This train is operated by KTMB and the final destination is Butterworth where you need to disembark and wait for another train operated by Thailand train authority. You will depart from KL Sentral around 2300 hrs and will reach Butterworth around 0600 hrs the next day. However, the train from Butterworth to Bangkok will only depart around 1420 hrs which means that waiting time will be around 8 hours. At the time of writing, Butterworth train station is undergoing renovation works (part of Malaysia double-track system) and there is nothing much you can do here unless you are okay with sleeping on bench or floor! Of course you can take a taxi from the station and go somewhere else (even Penang by ferry) just to kill the time.
The first time I took a train to Bangkok from Kuala Lumpur, I disembarked at Butterworth and I got bored of waiting and too tired to explore the town. The second time I traveled by train, I got ticket to Alor Setar (a city in Malaysian northern state of Kedah) via Senandung Langkawi. This train departs at 2120 hrs from KL Sentral and will reach Alor Setar approximately 0700 hrs the next morning. You can also go to Thailand via Senandung Langkawi but the final station is Hat Yai and you need to take another train to Bangkok. Train to Bangkok from Alor Setar (operated by Thailand authority) will depart from Alor Setar at approximately 1700 hrs. Therefore you have 10 hours waiting time. You can use this time to explore Alor Setar town which is a few minutes walk from the train station.
Traveling by train to Bangkok from Alor Setar takes approximately 18 hours. The immigration check point is in Padang Besar and here you will need to get your passport stamped before boarding the same train and continue the journey. This is the only stop where you will have time to buy food and drinks from the shops located on the second floor. You can also order your dinner from the train staffs and get them when the train reaches Hat Yai (a couple of hours from Padang Besar). It’s a long journey to Bangkok but if you have time and want to see the landscape, why not? The best experience for me was when I woke up at sun rise and enjoy the sea view (near Hua Hin). Hua Lamphong Train Station in Bangkok is the final stop where you can board another train to go to other part of Thailand.