The 35-year-old was left "extremely upset" by the incident, which happened on the 6.34pm Glasgow Central to Ayr service on Saturday.
British Transport Police (BTP) said she approached a group of men to check their tickets when one of them pulled her by the back of her head and made sexually explicit gestures.
The man responsible is described as being around 6ft and of slim build. He was wearing a grey flat cap and a wax-style jacket and jeans.
He spoke with a local accent and had been drinking. It is believed the group got on at Irvine and got off the train at Prestwick Town station.
Detective Constable Craig Jennings, of BTP, appealed for information, saying: "Anyone who was on the train or was at either station and who may have witnessed this unwelcome and unwarranted assault on someone just getting on with their work is urged to get in touch."
In a separate incident, a 19-year-old woman was subjected to an unprovoked attack by two men on a train when she was travelling in the area of Uphall, West Lothian.
She was approached by the pair on board the 10.13pm Edinburgh Waverley to Helensburgh service last night.
BTP said words were exchanged before the victim was grabbed and punched by one of the men and spat on by another.
Although very shaken, the victim did not require medical treatment.
Both suspects are described as being aged about 40 and of heavy build.
One of them had brown hair and was wearing a purple checked shirt and jeans. The other man was wearing a maroon jacket and blue jeans. Both of them spoke with Glasgow accents.
Detective Constable David McAllister said: "This was a completely unprovoked attack on a defenceless woman and I am anxious to speak with anyone who was on the train and witnessed it to come forward."