On Saturday, when she complained of pain, doctors suspected she had been abused and informed her parents, who approached the police.
Medical examination of the girl confirmed rape, a police officer in Nagapattinam district in east Tamil Nadu said.
The accused minors, aged 15 and 17, have been sent to a juvenile home.