Rather than bask in a post-Olympics glow, residents of Rio de Janeiro are having to relearn the run and crouch position as gun fights become an increasing feature again of life in Brazil’s second city.

The massive security presence that kept athletes and tourists safe during the Games in August has been withdrawn and the city’s drug gangs are adopting an increasingly confrontational approach, as captured by panic stricken residents on social media.

Though Rio is still significantly safer than a decade ago, footage on the evening news of gunfire echoing around beachfront middle class neighbourhoods has sparked fears the city is slipping back into lawlessness amidst the worst economic crisis to grip the country in decades.

The near decade-old “pacification” programme – which supposedly saw the gangs chased from the city’s favelas, which were then occupied by police – is in crisis. Its creator José Mariano Beltrame, the state security secretary, has just quit his job.

“I had hoped to leave Rio more pacified than it is,” he said on leaving, blaming the failure on the other branches of government, who failed to follow his officers into the slums in order to better the lives of residents there.

Now with the state government bankrupt, he worries the situation will only deteriorate, warning it will struggle to pay police salaries in December. His replacement, Roberto Sá, has already warned that a demoralised police force – some stations have asked local residents to donate toilet paper – could lead to a spike in violence.

The federal government provided emergency funding for Rio in order to get it through the Olympics. But now that the world’s media has moved on, and with other states in the union also pleading for help, its own straitened circumstances means there is unlikely to be much more aid coming.

Evangelical mayor

The man elected last month to steer the city through the crisis is new mayor Marcelo Crivella. He is a bishop in an evangelical church run by his uncle Edir Macedo, a former civil servant who transformed himself into a billionaire by founding the neo-Pentecostal Universal Church of the Kingdom of God.

Crivella has promised to seek a “partnership” with the federal government in order to tackle the city’s crisis, though his main political obsessions are ending any form of sex education in schools that addresses homosexuality and frustrating efforts to liberalise Brazil’s strict anti-abortion laws.

He finished almost 20 points ahead of left-wing human rights lawyer Marcelo Freixo in the October election, despite the emergence of a video of a sermon he delivered in 2012 in which he said gays deserve “comprehension” as their sexual orientation could be the result of a failed effort at abortion by their mothers.

He also suffered no electoral damage from the publication of a video of him telling a private gathering in the apartment of a local businessman that “because I am evanglical, because I have great penetration among the more popular classes, I can explain to them in a legitimate manner our plan, which is to look after the south zone” – which is where most of Rio’s upper and middle class live.

Freixo swept the south zone but it was not enough to overcome the grip of his evangelical opponent on the poorer northern and western zones of the city where the Pentecostal churches are strongest.

Crivella’s administration will be the first major test in office of the Brazilian Republican Party, founded by the Universal Church of the Kingdom of God in 2005 and whose ambitions are laid out in its founder Macedo’s 2008 book Plan for Power.

Now in control of Brazil’s second city, Macedo is a step closer to his ambition of conservative evangelical rule for Brazil. That goal horrifies Brazil’s left, which suffered its worst electoral reversal in the local elections.

But few of them want to remember now that it was the Workers Party president Luiz Inácio Lula da Silva, eyeing the potential of the evangelical vote, who encouraged Macedo to set up his political party.

Back then Lula though he could control and use it for his own political ends. But now the Workers Party is in a defensive crouch fighting for its political life amid multiple corruption scandals, while the evangelicals have achieved their first significant political breakout.