Jaime William Enriques, 54, one of the inmates injured in the fire at the prison in Comayagua Photograph: Str/AFP/Getty Images

The horrific fire in a prison in Honduras that killed more than 350 people was a tragedy waiting to happen. As anyone who has ever set foot in a prison in Latin America can testify, they are vastly overcrowded and understaffed, and many are effectively under the control of criminal gangs. To quote one recent report:

"The heat inside the cells is almost unbearable … [the prisoners] remain in their cells – and stinking hot – 24 hours a day, receiving only meals supplied by private contractors, whose behaviour was the subject of constant complaints. The cells do not have any kind of structure to receive the prisoners, not even beds. The prisoners did not have mattresses, having to sleep on the floor, which in some places is wet and soggy ... [in some places] the overcrowding is so bad that there was not room even for all of the prisoners to lie down at the same time ... Skin problems, due to the heat, humidity and lack of sunshine, are very common and several prisoners showed us boils on their backs and legs."

This was written not by Amnesty International, but a working group established under the authority of Brazil's supreme court to investigate the state of its penal system. After studying the cases of 400,000 prisoners, the working group released over 36,000 of them and found that over 70,000 were being held at inappropriate levels of security. This means that over 100,000 people were either being wrongfully detained or held in excessively harsh conditions in relation to the prison sentence that they received.

Identifying what is wrong with Latin America's prisons is relatively easy; finding solutions is more difficult. Latin America is one of the most unequal regions of the world and has historically suffered from some of the highest crime rates. Cities such as Bogotá, Caracas and Rio de Janeiro are so violent that they are often compared to war zones. Many of Latin America's criminal gangs were founded inside prisons to protest about prison conditions, and many of their leaders continue to control their activities from them. The Primeiro Comando da Capital (PCC), for example, which is among the most powerful gangs in São Paulo, was formed by prisoners who survived a massacre in 1991 in which 111 detainees died. In 2006 it organised a series of rebellions and attacks in which around 450 people are believed to have been killed.

Prison numbers are increasing throughout Latin America, compounding the problems of safety and overcrowding. This is partly due to inefficiencies in the system, a failure by judges to make more use of non-custodial sentences and the utterly misguided "war on drugs" that has been unleashed on the region. However, in some cases it is because the police are getting better at catching and convicting criminals. Violent crime is actually dropping in parts of Brazil and it is obviously preferable for the police to arrest suspected criminals rather than to kill them. But if detection and arrest rates go up and the conduct of trial becomes quicker, then this will put further strain on the already overburdened penal system.

A multifaceted problem requires a series of reforms across a range of different sectors. Brazil is currently developing a range of innovative practices that may be of relevance not just in other parts of Latin America, but the wider world. The supreme court initiative is one of these, but there are also a myriad of projects currently being implemented to help the rehabilitation of prisoners, provide legal alternatives to pre-trial detention, promote community justice and tackle the underlying roots of crime.

For the first time in decades, Latin America is experiencing a period of steady economic growth and rising living standards. Social programmes, such as Brazil's Bolsa Familia, are reducing poverty and inequality. The region's demographics are also changing, as birth rates decline, which should also help to tackle the roots of crime. There are good reasons, therefore, to be optimistic about the prospects for reform. But the tragedy in Honduras underlines the urgency of the task.