Government Railway Police sources said E Jaya Gopi, the accused, was drunk at the time.
He took the woman to an AC compartment on the pretext of collecting the fare difference, and allegedly made a pass at her.
She shouted for help and other passengers came to her rescue.
The 23-year-old woman had boarded the train in Chennai with a general ticket and had approached the accused for a reserved berth, said Gudur GRP Sub-Inspector K Srinivaschary.
Railway authorities later suspended him from service.
