Reported rape cases in India have climbed steadily over recent years to around 40,000 in 2016, or about 100 a day, with many more believed to go unreported. Child rape accounts for about 40 percent of the reported cases.
A mob blocked highways on Thursday and sat on railway tracks near Guntur, in the state of Andhra Pradesh, demanding public punishment for a rickshaw puller accused of the attack.
The crowd attacked the accused's house and thrashed his son, media said.
Several cases of sexual assault of children have come to light in recent weeks from different parts of the country, leading to an outpouring of anger.
The government introduced the death penalty for the rape of girls younger than 12 last month after a particularly gruesome case of rape and murder of a Muslim girl in Jammu and Kashmir state.
Police superintendent Venkata Appala Naidu said the girl who had been assaulted in Guntur was recovering in hospital.
Registered cases of sexual violence have been rising despite the national outrage that followed the fatal gang rape of a student on a bus in New Delhi in 2012.