Check the chart before boarding. If vacancy is there, you can request the TTE and board the train. When TTE comes to the particular berth, pay the difference of fare. He will allot the berth to you. This can be done in day/night trains. But only if there are availability and TTE permits you. I have done that in Manglore express from MAS to PTJ. You can also take advantage of PQ. For example, in Manglore express, most of them board from PTJ or PGT, those berths remain vacant from MAS to PTJ. I used that.