You can buy train tickets from the railway ticket counters as well as from the official government railway website online.