Police issued CCTV photographs and a mobile phone image of Neil Docherty taken by a disgusted fellow passenger in bid to track him down.
Livingston Sheriff Court heard that within a matter of hours members of the public – appalled at his racist rant – called cops with his name and place of work.
Docherty, 43, of Linlithgow, West Lothian, appeared in court today on a bail undertaking and pled guilty to two racially aggravated offences.
He admitted assaulting Fella Hammach, 33, on board a Glasgow Queen Street to Edinburgh train at Linithgow, West Lothian, on August 28.
He also admitted acting in a racially aggravated manner which caused or was intended to cause alarm and distress to Ms Hammach by shouting and swearing, acting in an aggressive manner and directing religious remarks towards her using racially offensive language.
Catherine Knowles, prosecuting, said the assault was witnessed by several passengers on the train, which was packed with revellers returning from a night out.
As the train pulled into Linlithgow station at around 11pm Ms Hammach was unexpectedly slapped to the right side of her head from behind.
She said: “The accused was overheard shouting at her: ‘Go back to your own ******* country. Muslim men are raping women’.”
The fiscal said a female passenger told the accused to shut up, but he ignored her and shouted: “It’ll be a different story when they take over the world and you’re all wearing burkhas!”
He continued to make racial comments until he left the train at Linlithgow station.
Mrs Knowles said a passenger collected the names and contact details of everyone who’d witnessed the incident and passed them to the conductor who contacted British Transport Police.
Officers were waiting at Edinburgh to take statements from them and a copy of the camera phone image. They later obtained CCTV footage from the train.
After a public appeal Docherty surrendered himself to police and was detained.
Gilliam Taylor, defending, said her client worked as an investment banker and would co-operate with the preparation of reports.
Sheriff Peter Hammond called for Criminal Justice Social Work background checks.
Docherty will be sentenced later.