If intimated in advance before boarding or immediately after boarding no penalty will be levied. But if caught by the TTE or the squad one or two stops after boarding point then fine will be levied. I have travelled a number of times during day time by West coast express in day time and by the Kerala bound trains coming from North for my journeys from mas to cbe. Even if vacant berths are not available, the TTEs politely advice to get down at the next station and board the general compartment.
Once when I found no TTEs in the sleeper class on board but a number of berths vacant, I walked upto the AC compartment through...
more... the vestibules and informed the TTE there. He agreed to request the TTE concerned to come to my place and collect the difference in fare. But the TTE reached my place only after the train reached JTJ and collected the fare from kpd to cbe and also suggested that if any squad comes, I have to inform them that I boarded the sleeper class at kpd only.
Similarly on another occasion, I boarded the intercity express from cbe to mas and requested the TTE for a seat in AC CC. He suggested me come the AC coach at ed. He allotted the seat from ed quota for which the reserved passenger has not turned up and collected the fare from ed to mas only.