How to upgrade to a higher class once on the train in India
Most train only have a small amount of AC seats (1st class) or sleepers. However they require booking in advance
If you failed to book like I did, you can buy a general ticket and go stand outside the AC class. Once the train start to move, you can go find the conductor inside the cabin and ask to upgrade for the next available seats once people start to get off.
I was able to upgrade halfway and it cost me only 100rs when going from Cochin to Varkala and instead of standing for the rest of the journey (Indian trains are slow! It was a 6h ride)
The conductor will let you know which seat you can sit when the current passenger is gone.
This requires some luck, as you can only upgrade if there are people leaving. There were people "lining-up" before me but lucky the process was quite civilized.