From Bangkok’s main railway station (Hua Lamphong) there are two lines going north-east:
Bangkok to Ubon Ratchathani, or Bangkok to Surin.
In either case get off the train in Nakhon Ratchasima/Khorat, then take a Tuk-Tuk or a Taxi
to the (new) bus terminal and ride a local bus to Phimai/Chumphuang.
[Allow at least six hours for the train trip from Bangkok to Nakhon Ratchasima.]