The young Brazilian protester on the Copacabana seafront had to shout to make himself heard above the sound of trucks blasting out criticism of President Dilma Rousseff and her Workers party.

“We have to get rid of them. They are communists who are trying to link up with Venezuela, Argentina and Cuba so they can turn Latin America into one big Bolivarian socialist republic,” yelled Eduardo Mendes, a computer science student. “It has gone too far. Today we’re bringing two million people on to the street to show in a peaceful demonstration that Brazil will never allow that.” His words were defiant and contentious, but there was no doubting the sincerity of the feeling behind them. After more than 12 years of leftwing rule, Mendes was desperate for a turn in the political tide.

Until a few years ago, that might have been dismissed as wishful rightwing thinking. Back then, Rousseff was riding high in the polls. The economy appeared to have escaped the worst of the global financial crisis. Social welfare programmes, such as the bolsa familia cash handouts, had sharply reduced extreme poverty. Brazil was pre-eminent in a Latin America so dominated by leftwing governments – Hugo Chávez in Venezuela, Evo Morales in Bolivia, Rafael Correa in Ecuador, José Mujica in Uruguay, Daniel Ortega in Nicaragua and Raúl Castro in Cuba, among others – that people talked of a “pink tide”.

But tides ebb as well as flow, as Rousseff and several Latin American leaders are being forced to realise, amid growing public hostility, an increasingly unfavourable global economy and a series of spectacular scandals that have highlighted the ethically corrosive effects of more than a decade in power.

Mendes was far from alone in his outrage. The protests last week were among the biggest ever witnessed in Brazil. Estimates of the combined total of protesters at rallies in more than 150 cities range from hundreds of thousands to more than 1.5 million. Even among those who stayed at home, Rousseff is immensely unpopular. Her “good or great” approval rating fell last week to 13% – the lowest of any president since Fernando Collor de Mello was impeached in 1992.

She has been hit by the twin blows of a stagnating economy, which is expected to slip back into recession this year, and a jaw-dropping corruption scandal at the state-run oil company, Petrobras. More than 100 executives and politicians of all ideological stripes have been implicated in at least $3bn of kickbacks, bribery and money-laundering dating back to the 1990s and ramping up enormously after the Workers party won power.

Prosecutors have cleared the president of responsibility, but few Brazilians believe she was unaware of what was happening because she was president of Petrobras during the period when the corruption was at its height. In the latest blow, her party’s treasurer, João Vaccari, was formally charged last week with soliciting donations from political slush funds illegally built up by Petrobras officials.

Brazil’s President Dilma Rousseff has seen her popularity plummet. Photograph: UesleI Marcelino/Reuters

Corruption in Latin America long predates the emergence of leftist governments in the early 21st century. But the venality and cynicism of Workers party officials caught up in the Petrobras scandal stand in contrast to the idealistic values of the São Paulo Forum, which since 1990 has brought together a wide range of left-leaning groups in the region, including Nicaraguan Sandinistas, Cuban communists, the Brazilian Workers party, the Socialist party of Chile, Chavismo supporters in Venezuela and the ideologically mercurial Peronists of Argentina. If the “Latin left” exists – which is questionable, given the very different circumstances of each nation – then this is the organisation that binds them together with the shared objectives of fighting inequality and neoliberal economics, strengthening regional integration and working towards a world in which diplomacy and trade is rebalanced away from the US and towards China, Russia, Iran and emerging economies such as Turkey and Indonesia.

Several prominent members are now on the ropes. In Argentina, President Cristina Fernández de Kirchner has seen her approval ratings fall below 30% as the economy has slipped close to recession. Hundreds of thousands of protesters have rallied in Buenos Aires over the suspicious death of prosecutor Alberto Nisman, who was found with a bullet in his head just hours before he was to testify before congress that the president had allegedly conspired with Iran to cover up the deadly bombing of a Jewish community centre in 1996. She is also something of a lame duck, with her second term due to expire at the end of the year, when she will be barred by the constitution from standing again.

In Venezuela, just 22% approve of the job done by President Nicolás Maduro – the lowest rating since he replaced Chávez two years ago. Like Rousseff in Brazil after Lula, he lacks his predecessor’s charisma and faces harsher economic challenges, including nosediving oil prices, sky-high inflation, a rampant black market and worsening shortages of basic goods. Violent street protests left more than 40 dead last year. This year, at least one student has been killed in continuing unrest.

Argentina’s President Cristina Fernández de Kirchner. Photograph: Enrique Marcarian/Reuters

There are common threads behind these recent declines, according to Armando Castelar, former head economist at the Brazilian Development Bank. “For the past decades we have enjoyed extremely favourable conditions, thanks to the China-driven commodities boom and the abundance of international liquidity, but now we are seeing a major change. This is happening for the first time since the leftwing governments came to power. Until now they have enjoyed exceptionally good international conditions. Now they have to deal with setbacks.”

This has left less money for social programmes that were already starting to feel the pinch of diminishing returns after big initial success. Poverty reduction has almost stalled in Brazil and Argentina since 2013 and has slipped into reverse in Venezuela. This contrasts painfully with the greater recent success of centre-left or centre-right governments – like Chile, Peru and Colombia – in dealing with poverty. But the issue is not black and white. Bolivia, which follows a radical political path under Morales, has one of the region’s best performing economies.

Beatriz Bissio, a political scientist from Uruguay, said it was too early to say the left was on the way out. “If we are to look only at the demonstrations in several countries, or what is happening in Venezuela, then we will see a certain retreat, but I would not yet conclude the left is going backwards and the right moving forwards. We are in a complex situation,” she said. “We are entering a difficult time, but in the medium term perspective I am not pessimistic. The process of progressive change will continue. Latin America has gained political maturity.”

This situation has been aggravated by disputes with the US, international capital markets and major media conglomerates. Argentina cannot access international credit because “vulture funds” refuse to accept a debt repayment plan. Venezuela is facing sanctions by the US. Big international investors such as George Soros have reduced their holdings in Brazil’s companies and driven down the currency to its lowest level in 10 years.

Many see a conspiracy at work. “The Latin American left is coming up against an enemy that it has never prepared itself for,” said Federico Neiburg, an economic anthropologist at the Museu Nacional. “It’s an alliance between shifting geopolitical interests, economic and financial elites trying to impose politics that are beneficial to them, and political action on behalf of the media. The media is one of the most important players in this game. If we follow what they say, then the days of the progressive governments of Latin America are coming to an end. But that is not a diagnosis of the situation, it’s a bet.”

The odds, however, are shortening with each drop in GDP growth and presidential approval ratings. Castelar said the election in Argentina in October is likely to be the first big test of whether there has been a shift in the public mood. “But regardless of whether the left loses in the short term, they will have solidified their reputation for championing social issues and individual rights, and that will serve them well in the long run.”

The “pink tide” may be looking a lot murkier than 10 years ago, but it is not over yet.

Additional reporting: Shanna Hanbury