The 27-year-old woman and her partner boarded a delayed service at Sheffield, which was bound for Leeds.
Before the train left the station, the victim’s partner went to the toilet and left her sitting by the window.
It was then that the man sat down next to her and tried to rape her.
The victim’s partner returned from the toilet unaware of what had taken place and physically moved the man from his seat.
British Transport Police is now appealing for information from those who travelled on the 10.24pm train on Saturday, November 19.
Detective Constable Ian Grice said: “Sexual offences of this nature on the railway network are rare, but are understandably incredibly distressing for the victim.
“We take any offence of this nature extremely seriously and we doing everything possible to identify the offender.”
He said the victim was being supported by specially trained officers while the investigation continued into establishing exactly what happened.
The train was delayed that night and left Sheffield from platform 1B at 10.40pm.
The victim and her partner got off the train at Swinton railway station, but it is not known where the offender left the service.
Police said it was believed that he was travelling with another man.
The offender is desrcribed as white, aged in his late twenties to early thirties, with brown hair. He was wearing a blue Puffa jacket.
The man who he was potentially travelling with was also white, aged in his late twenties to early thirties and wearing a black Puffa jacket.
Det Con Grice said: “I would like to hear from anyone who was on the train who has not yet spoken to police, who may have seen or heard anything that could help with our investigation.
“If you recognise the description of the offenders or have any information, no matter how insignificant it may seem to you, please contact me either by calling 0800 40 50 40 or by texting 61016, quoting reference 147 24/11/16.”
Information can also be passed onto Crimestoppers anonymously on 0800 555 111.