The men had been in police custody and were shot near the scene of the crime, said N Prakash Reddy, a deputy commissioner of police in Shamshabad, near Hyderabad.
"In the morning, at around 6-6.30, our persons have come to reconstruct the scene of crime and the accused have tried to snatch their weapons, and there was a cross-fire. In this, all the four accused have died. Two policemen have been injured," Reddy said.
Earlier a local police official had put the time of the deaths at around 3:30 a.m. (2200 GMT Thursday). There was no immediate explanation for the discrepancy.
During the past week, thousands of Indians have protested in several cities following the alleged rape and murder of the woman.
Many Indians seemed to applaud the killings, taking to Twitter to support the police.
"Not sure whether this is right or wrong but feeling very happy..just hope and pray that the ones killed were the real criminals..#hyderabadpolice," wrote one user."Quick Justice like this will inculcate fear into the Dirty minds. Our sincere prayers have been answered #hyderabadpolice Hats off," actress Ammu Abhirami posted.