The incident took place when the girl hailing from Hyderabad was offering prayers at a smaller temple on the premises of the 12th-century shrine.
According to the complaint, the victim and the accused were travelling to Hyderabad from Pune in the same train.
In her complaint, the diplomat said she raised an alarm and even ran after him, but the man sped away, the police added.
The petitioner's counsel submitted that the complainant was ready for reconciliation and an affidavit to the effect was appended.
An official said that the police nabbed the accused from Kasam Nagar locality of Jogeshwari in the early hours of the day
Police said the accused allegedly sexually molested his own daughter when her mother was not around and the girl confided in her mother as her changed behaviour towards her father came into notice.
The incident came to light three days ago when the girl, who was allegedly molested by Vinod Kumar, SHO, Rajpur, attempted to take the extreme step by consuming pesticide.
An unverified video showed a group of 8-10 men thrashing the bangle seller, looting his bangles and asking girls and women of the area to take the looted bangles
The victim, meanwhile, managed to click a photograph of the attacker and handed it over to the cops.
In the videos, hundreds of young men can be seen throwing the girl in the air for fun, dragging her, tearing her clothes and molesting her.
Sources said the victim was performing her duty in the hospital on Tuesday night when Badal Singh allegedly grabbed her hand and forced himself on her.
A district court on Thursday sentenced a man to 20 years in prison for molesting a four-year-old girl last year.
A video of the woman, who is trained in martial arts, accosting the accused and forcing him to reveal his name has been widely circulated on social media.
Separate cases were registered against the accused doctors under various sections of the Indian Penal Code for outraging the modesty of a woman and criminal intimidation.
Malappuram police on Tuesday arrested three youngsters who sexually abused a girl after befriending her through social media.