The victim, travelling from Gaya to New Delhi, was molested by Ameen Sheikh (28), who was in an inebriated condition, when she was asleep last night, station officer of GRP Ratan Singh Yadav said.
The girl raised an alarm and fellow passengers came to her rescue. The man was handed over to the Government Railway Police (GRP) at Mughalsarai.
Police said the man was drunk and does not have any past criminal record.
The girl, who is a resident of Gaya and studies in Delhi, told police that a few other pantry staffers were loitering around the wash room and were drunk.
A case has been registered and a probe is underway, said spokesman of the GRP.
This is the third incident of molestation on trains in Uttar Pradesh in less than a week.
The first was Oct 1 when a senior Indian Administrative Services (IAS) officer of the Uttar Pradesh government was arrested for molesting a woman on board the Lucknow Mail train.
Two days later, on Oct 3, another state government official was charged with outraging the modesty of a woman.
J. Jayalalithaa passes away: Her life in pictures
Photos: Shah Rukh Khan, Deepika Padukone, Alia Bhatt at an awards show
Photos: Big B, Iulia Vantur at Himesh Reshammiya's album launch
Photos: Aamir Khan with 'Dangal' actresses at fashion show
Spotted: Twinkle Khanna, Shriya Saran at an event in Mumbai