The 28-year-old woman was initially travelling in an empty carriage on an RER train in Paris on the night of December 9th when around ten men had got on the train at Montparnasse station.
The woman started to feel uncomfortable and decided to sit elsewhere, reported Le Parisien newspaper.
Three of the men, reported to be Afghan refugees, followed her and soon began to assault her. One of them strangled her with her scarf and another held a knife to her face while the three men began to undress her, reported the paper.
By chance at the next station another passenger boarded the train and intervened to protect the victim. He managed to scare off the attackers.
The woman rushed to a nearby restaurant where she took refuge. She was left severely traumatized a source close to the case told Le Parisien.
Police were able to catch two of the alleged perpetrators thanks to the help of CCTV footage at the Montparnasse station. They were both Afghani refugees, aged 19 and 45 years old, men who the victim was able to identify, Le Parisien reported.
The incident has emerged as the issue of sex attacks by immigrants and refugees continues to cause a storm in Germany after reports of mass assaults on New Year's Eve in Cologne.
Both police and the media came under fire from the public, who accused them of covering up the ethnic backgrounds of the alleged attackers and sweeping the problem under the carpet.
Under pressure to give more details on the attacks, German police later confirmed that men of ‘Arab background' were likely responsible for the dozens of sexual assaults on women.
Politicians have since urged the public not to stigmatize the hundreds of thousands of refugees who have entered Germany in recent months.
In France there have only been isolated reports of sexually assaults allegedly carried by migrants, although some far right blogs have suggested the problem is far more widespread and under reported.
The two men were charged with attempted rape and have since been remanded in custody.
Both men have reportedly denied the crime.
They said they were forced to flee Afghanistan after being pressured to carry out crimes against the western world, reported the paper.
Their accomplice remains on the run.
Sexual harassment on public transport in France has proven to be an all-too-common problem of late.
Story continues below…
In November, the government launched an awareness campaign to encourage victims and witnesses to speak out with confidence about sexual harassment on public transport.
The move came shortly after France's High Council on equality (HCEfh) raised the alarm about the issue, when its survey of 600 women in Seine-Saint-Denis and Essonne, two areas in the outer suburbs of Paris, revealed shocking responses.
It found that 100 percent of the women said they had experienced at least some form of gender-based sexual harassment in their life while riding the train.