It seems that most travellers end up passing through the place at sometime if they are heading towards Malaysia.
It is unfortunate that the trains heading to Penang are only twice daily, and the first one leaves at a ridiculously early time in the morning.
Heading the other way south (on the eastern seaboard) there is about 20kms of track missing so a 15-20 Ringgitt taxi ride is needed to get to Kota Bharu (the station is a few kms out of town) from where you can pick up another train in Malaysia.
Heading the other way up to Bangkok is much more straightforward - and there is a reasonable choice.
If you can stretch to Ist class then you get your own double room (bunks) and air-conditioning. You can also buy meals that are brought to your room. They are quite passable as meals and help to pass the time.
If you would like to make a trip to hat yai from kuala lumpur, the best way and confirtable sleep, is with Keretapi Tanah Melayu berhad (KTMB) this train will make a move from kuala lumpur at K.L Sentral station at 8.15pm, i am not sure if everyday or a few times in a week. And the train journey will take you about 15 hours journey, so you will be reaching to Hat Yai train station at 11am or 10am thai time in the next morning. The fees from K.L to hat yai only RM45 for bed, but this is not a 1st class bed, it just mid class, but it was ok for me...
Other than that, you can take a bus from Pudu raya station to hat yai and the cost is about the same as train fees, but you will be reacing at thailand boarder at 6am and the bus driver have to wait until the boader open at 7am, and after all immegration deals settles for all pessanger and they straight make a move to hat yai, and you will be reaching there at 9am (malaysia time) or 8am(thai time).. from there you can choose your next destination, coz there are a lots of travel agency waiting for you.
The Hatyai Railway Station is right in the centre of the city... It can be said that the rapid growth of Hatyai over Songkhla is because of the siting of the railway interchange in Hatyai... and hence the station is known as Hatyai Junction... The train is still a popular mode of cheap transport in Thailand...
The train goes northward to Bangkok from Hatyai passing thru Surat Thani, Chumporn and Hua Hin... There are 2 separate lines going to the south, with one line going to Malaysia thru Padang Besar and the other line going to Sungai Golok thru Yala on the east coast... The Bangkok International Express goes from Butterworth (in Malaysia) to Bangkok passing thru Hatyai...
I haven't actually used the train to get to, or from, Hat Yai but the city is well connected by rail to Bangkok and Butterworth in Malaysia. The train schedule to various destinations is posted clearly (in English) in the station.
Beware of touts around the station. Unscrupulous Tuk-Tuk drivers feed on fresh, newly-arrived farangs and this is a favourite feeding ground. One kind Tuk-Tuk driver offered me a ride to Songkhla (which would be extremely uncomfortable in a Tuk-Tuk) for just 700 Baht. He seemed slightly taken aback when I laughed even though I tried to explain why I was laughing. I tried to tell him that I could get there in a comfortable, air-conditioned minibus for 21 Baht like the locals do. Well, I guess as long as there are stupid farangs around there will always be scam artists around preying on them.
The route between Malaysia and Thailand is as follows:
Butterworth, Sungaikolok, Yala, Pattani, Hat Yai, Phattalung, Thungsong, Surat Thani, Chumpon, Pa Chuap, Hua Hin, Cha Am, Petchaburi, Ratchaburi, Nakhornpathom, Bangkok.
Here are details from a timetable I picked up but CHECK LOCALLY fist before making plans.
To Bangkok the trains leave Hat Yai at 14:19 (05:15), 16:02 (10:45), 16:45 (11:10), 17:47 (11:40), 18:45 (12:10) - arrival times in brackets.
To Butterworth the train leaves Hat Yai at 07:40 and arrives at 12:55.