If a railway passenger is traveling in a class that is not mentioned in the ticket or the passenger is traveling in a higher class of compartment then also he is entitled to get punishment under law.
If the concerned railway ticket checking authority catches such passenger then the passenger should pay the difference of fare between the two categories of coaches. If the railway passenger is unable to do so then there is a provision that the passenger may even land up in jail and have to stay there for a period of one month.
Passengers generally traveling short distances on train do such kind of activities but they should always remember that if they get caught by concerned authority or railway people it will land them in trouble.