An 18-year-old girl and her mother, 38, travelling on board the Lucknow Mail train were allegedly molested by a man.
The accused was later arrested at the Moradabad station.
The arrest was made after the girl informed her father in Lucknow over the phone and he informed the railway ministry, the UP Police and the Superintendent of Police about the incident via tweet.
RPF, GRP swing into action
The information was passed on to the Railway Protection Force (RPF) and Government Railway Police (GRP) who swung into action, traced the train's location and nabbed the accused at the Moradabad railway station late in the night.
The accused allegedly misbehaved with the RPF personnel. "He has been sent to jail after being produced in court," said GRP inspector Sudhir Kumar.
The accused was identified as Aditya Singh, 27, a resident of Ayodhya, said Kumar.