An Indian woman has been set on fire on her way to a court hearing to testify against two men who had allegedly raped her.

The 23-year-old is in a critical condition in hospital with 70% burns after she was set upon by five men in the city of Unnao in Uttar Pradesh. They dragged her to a field, doused her with petrol and set her alight.

It is the latest in a series of brutal attacks against women in India that have caused a wave of outrage across the country. Last week, a 26-year-old veterinary doctor in Hyderabad was gang-raped then asphyxiated to death and her body burned and dumped. Days later, in the state of Bihar, a teenager was allegedly gang-raped and killed before her body was set on fire. In response, thousands have taken to the streets in protest this week, demanding better protections for women.

In the assault on Thursday, two of the attackers were said by police to be the same men the victim filed rape charges against in March. The young woman was on her way to a hearing to testify against her alleged rapists when the five men grabbed her by the railway station. One of the accused was out on bail while the other had been on the run from police.

“The two men set fire to the 23-year-old alive to take revenge,” said a senior police officer, SK Bhagat.

Police said the woman had been in a relationship with one of her attackers last year. He had reportedly promised marriage, physically exploited her and then raped her with another friend.

The case prompted criticism that the woman’s alleged rapists had been let out on bail. Supriya Sule, an MP for the Nationalist Congress party, tweeted: “Extremely sad and shocked to hear that that Unnao rape victim was burnt earlier this morning. If the culprits were not shielded and [were] prosecuted on time this wouldn’t have happened. Complete state of lawlessness in the state of Uttar Pradesh.”

Sakshi Maharaj, the MP from the ruling Bharatiya Janata party (BJP) for Unnao, described the incident as “really unfortunate”. He echoed the popular BJP view that the rapists should face capital punishment for their crimes.

The recent series of attacks and killings have once again brought to the fore India’s problem with sexual violence: more than 32,000 rape cases were reported in 2017, according to government figures, but the real figure is believed to be far higher. However, activists have expressed frustration at calls by the government to deal with the problem simply by introducing the death penalty for rapists, arguing that it does not tackle the underlying social causes of violence against women and the misogynistic attitudes underpinning the crimes.

Such views were on full display in a series of social media posts by the Indian film director Daniel Shravan, who, in response to the Hyderabad rape case, suggested that “rape is not a serious thing, but murder is inexcusable” adding that “the government should legalise rape without violence for the safety of women”.

The posts, now deleted, addressed women, telling them: “If you are about to get raped, hand over a condom to the rapist and cooperate with him while he fulfils his sexual desire. That way he will not try to harm you.”

The comments attracted an onslaught of condemnation online. “He is advocating rape as punishment for women. What will it take to make women feel safe? How many men will be let off,” said a tweet from the #MeTooIndia Twitter account.