The 24-year-old graphic designer from Berlin was travelling around the country alone and she was waiting for a train north from Mumbai's Bandra Terminus, India TV reported on Tuesday.
The woman was two hours early for her train and was sitting reading in the waiting room, but fell asleep.
According to police, the accused entered the room in a drunken state. He then masturbated in front of the woman and started touching her.
She woke up and screamed for help and the Railway Protection Force arrived and arrested the alleged attacker, who is being held by Mumbai police.
The traveller was in a state of shock, but decided to continue her trip to Ajmer, in northwest India.
The attack follows other recent incidents of sexual violence reported in the country.
Earlier this month, a German teenager was raped by men on a train in the south of the country. In the same week, a Danish woman was also raped by a group of men in New Delhi, prompting concerns over the safety of tourists in India.