Here are all the list of reasons for filing TDR of ticket for refund. If it is e-ticket you can simply file it online on the next day of journey day and up to maximum of 30 days. Otherwise you forfeit your right for refunds admissible.
Source: As worded by Indian Railways, Government of India
The electronic reservation slip cannot be cancelled at any regular counter of the Railways. The electronic reservation slip can only be cancelled online.