Just posted a story about the rise and fall of Hat Yai railway station. You can read it here
The following is a simple hand made map which i ask a Thai friend who is a travel writer drawn it for us here at Eastcode.
The Hat Yai city(sometimes call Haad Yai or Had Yai) is actually a sub district in the Songkhla(สงขลา) provice but now become bigger than the head one and growing .Both town separate about 26-27 km. away. Some expect that in the near future the twin city will reach out togenther to become a single urban landscape soom.
We can see from the map that the railroad from Bangkok down to deep south branch away at Hat Yai junction city ,on the left gone through Padang besar then link to the Malaysian train system.This one is safe and easier to cross on the route to KL or Penang or Singapore(or from Malaysian side to Phuket or Krabi via Hat Yai.
On the other hand ,Anathor train line and road leads to Pattani(ปัตตานี) and Yala(ยะลา) and Narathiwas(นราธิวาส) province Then stop at a trading town of Sungai kolok(สุไหงโกลก)bordering the Kelantan state of Malaysia. I do not recomend to use this route because of a continued unrest and fights between separatist movement and Goverment's force in that area.