Source: As worded by Indian Railways, Government of India
If you were forced to travel in a lower class for want of accommodation, you can get a refund of difference of fare between fare paid and fare for the class actually traveled. This refund should be claimed within 2 days of the date of issue of the certificate (excluding the date of issue) of the arrival of the train at your destination. To claim this refund, you will need to submit your ticket along with the certificate issued by the Traveling Ticket Examiner.