He will charge you with penalty + cost of full journey in the class where you were found..
Like if a train is coming from Mumbai to New Delhi and you don't have a ticket and have boarded from Nasik, then also you might have to pay full fare. If you have at least general ticket, then the charge will be from Nasik to Delhi..