Television images have been released showing lawyers beating up the 18 men on the staircase of Chennai's high court as they were brought in.
The men were arrested on Monday on charges of rape, attempted murder and criminal intimidation.
The vision shows one man One cowering in a corner, trying to protect himself from the blows, while passers-by took pictures on their mobile phones.

Women soldiers of Central Reserve Police Force keep vigil to thwart student protests in Srinagar, April 2018. Source: Getty
The eighteen men appeared in court in the Indian city of on Tuesday on charges of repeatedly raping a 12-year girl over a seven-month period.
The hearing-impaired schoolgirl was allegedly sedated and given spiked soft drinks by her accused attackers.
The men aged between 23 and 66-years-old included security guards, lift operators and plumbers working at the apartment block where the girl lived, police said.
On average, over a hundred cases of women being raped were reported every day in India in 2016, according to the most recent figures made available by the national crime records bureau.
Around six of those were girls below the age of 12.
The men in Chennai sedated the girl with drugs and then took her to vacant apartments in the block to assault her, police said.
Local media reports said they had threatened her with knives, and told her they would release videos of the assault if she told anyone.
But on Saturday, the victim told her elder sister who was visiting from Delhi, prompting the family to file a complaint, the Times of India said.
The Indian government recently approved stringent punishments for sexual violence against children, including the death penalty for those convicted of raping girls younger than 12 years.
The decision came amid spiralling outrage over the rape and killing of an 8-year-old girl in Jammu and Kashmir and several other cases of sexual assault involving minors in recent months.