Lived in both (Bangkok and Phuket) and used the railways extensively. Nice way to get about in Thailand IMO.
Phuket (obviously) doesn't have a train station but is still reasonably accessible from Surat Thani to Malaysia and Singapore plus trains north to Bangkok. All longish journeys though but a night train is quite pleasant. I did those journeys on many an occasion.
Bangkok is much better for trains to North and Central Thailand. All depends what you want to see and where you want to go really. Flying is quicker and cheaper but I don't fly, unless I have to, and found trains a very nice alternative and preferable to the buses.
Feel free to PM me with any questions.