The teenager was attacked while asleep on a train travelling from Mangalore in western India to Chennai on the east coast, where she was heading to volunteer with a charity.
Police said she was reportedly too scared to shout for help and alert passengers in her carriage, Indian news site NDTV said.
Officers said a man had been arrested in Chennai on suspicion of the rape.
The German, said to be just 18 years old, complained to police on Monday, three days after the alleged attack.
Seema Agarwal, Inspector General of Police, said: “The young lady took several days to muster courage to report to the police. Though it's too late for medical examination, we have handled the case in a very sensitive manner,” NDTV reported.
Story continues below…
On Tuesday a 51-year-old Danish woman was allegedly robbed and gang-raped in the capital New Delhi. Police said 15 men had been arrested.