Seventeen others were injured and taken to hospitals in Langroud city, about 200 kilometers (125 miles) northwest of the capital, Tehran, state TV said.
The incident has strong echoes of the case of Mahsa Amini, who died in police custody in September 2022, after being detained for failing to obey the dress code.
The death of Armita Geravand comes after her being in a coma for weeks in Tehran and after the one-year anniversary of the death of Mahsa Amini and the nationwide protests it sparked.
Two people, including a senior Biden administration official, said that the prisoners had left Tehran.
The pair were hanged at dawn on a street near the shrine in Shiraz, the capital of Fars province.