Train 38-46 from Hat Yai Junction Station to Hua Lamphong Station in Bangkok is a Special Express overnight service with a mix of seat and sleeper carriages, from 3rd, to 2nd, to 1st class.
3rd Class seats in a fan cooled carriage:
2nd Class seats in a fan cooled carriage:
2nd class day and night carriages (Air-conditioned):
1st class day and night carriages (Air-conditioned):
You can book the entire 1st class compartment for sole use for - Adult 2,094 Baht - Child 1,727 Baht.
3rd and 2nd class seats area available in fan cooled carriages.
The 3rd class carriages can get quite crowded and not recommended for this long overnight trip (unless you are a really tight budget).
2nd class seats offer more comfort (they recline) so are much easier to get some sleep on.
The 2nd and 1st class Day and Night carriages offer much more comfort as the seats are turned in to beds soon after the train leaves Hat Yai.
Some people find the air-conditioning too cold, so bring something warm to wear (you do get a blanket, but sometimes that's not enough to keep you warm).
Tickets for the route are available up to 90 days ahead.
To book advance tickets you can:
1) Visit any SRT Railway Station and buy tickets in person.