Source: As worded by Indian Railways, Government of India
Yes, there is. You can stay at the AC and Non AC Retiring Rooms and Dormitories, available at important stations. This transit accommodation can be availed by passengers holding valid tickets, on payment of prescribed charges. You can approach the Station Manager or Matron to find out about the availability of accommodation and the prescribed charges.