Latin America's largest economy is in its fourth year of disappointing growth and slipped into recession in the first half of the year. Weaker consumer spending, a cooling labour market and a slide in investor confidence mean 2015 is also likely to be tough.

Modest credit growth and higher default rates may also persist next year regardless of who wins this month's presidential election - the leftist incumbent, Dilma Rousseff, or the centrist favoured by investors, Aecio Neves.

All of those problems typically drag on bank earnings, but giants like Itaú Unibanco Holding SA (>> Itau Unibanco Holding SA), Banco Bradesco SA (>> Banco Bradesco SA) and state-run Banco do Brasil SA (>> Banco do Brasil SA) could all buck the trend.

By streamlining costs and focusing lending on the most creditworthy borrowers, private-sector banks look well-positioned to navigate any choppy waters ahead, said Saúl Martínez, a senior analyst at JPMorgan Securities.

"The question here is, if there's a shock in unemployment or an abrupt downturn in economic growth, how each player in the banking sector will act, how their asset quality indicators will perform," he said. "Private-sector banks look relatively well-prepared to face that situation."

State-run banks, on the other hand, look more exposed to a weak labour market that may spark an uptick in defaults and force them to make additional loan-loss provisions.

In that group, analysts said the risks look greater for Caixa Econômica Federal [CEF.UL], an unlisted government lender that has aggressively increased lending and charged lower interest rates since 2009, than for Banco do Brasil, the nation's largest bank by assets.

Earnings at Itaú and Bradesco, Brazil's top-two private-sector lenders, could expand 10 percent or more next year as their strategy of growing credit in low-risk segments like payroll-deductible lending and mortgage loans will help keep a lid on provisions, Deutsche Bank Securities' Tito Labarta said.

There's another reason to be optimistic about Brazilian banks. Because Rousseff's attempts early in her term to strong-arm banks into lowering interest rates and increasing lending ended up backfiring, investors are betting on less state intervention in the financial sector going forward, even if the president is re-elected.

She is running neck-and-neck in polls with Neves, the investor favourite, ahead of the Oct. 26 runoff. [ID:nL2N0S81X3]

Hopes of less state intervention, regardless of who wins the election, have helped drive up banking shares since the start of August. Itaú has gained 10 percent, Bradesco 12 percent and Banco do Brasil 24 percent, compared with the benchmark Bovespa stock index's <.BVSP> 3.7 percent rise.

During the same period, the shares of these three banks have traded between 7 and 10 times price-to-earnings, the most volatile such range in 2-1/2 years, according to Goldman Sachs Group Inc.

Multiples could hit 11 times earnings if whoever wins the election embraces a pro-market reform agenda for the sector, according to Barclays Capital analyst Cristina Marzea.

There is mounting optimism that the next administration - regardless of its political orientation - will face pressure to implement more business-friendly policies. That would trigger an investor re-rating of the financial sector, a decline in risk perception, funding costs and, eventually, in interest rates.

Marzea raised Itaú's earnings estimates for 2015 by 5 percent on Monday and kept them broadly unchanged for Bradesco and Banco do Brasil, regardless of how badly the $2.2 trillion economy does next year.

PRUDENCE

Unlike in the past, investors are picking bank shares as a way of protecting the value of their portfolios during this year's recession.

In general, the view is that lenders are poised to post strong returns on equity, control loan-loss provisions and continued generous dividend payouts even if activity slows further.

Itaú, for example, posted a record profit and return on equity near a five-year high in the second quarter.

Banking executives, however, are sounding a slightly more cautious note in case the road ahead is rockier than expected, hoping to temper investor optimism by stressing that earnings are not immune to the economic slump.

The correlation between economic growth and earnings will only increase going forward, Marcelo Kopel, Itaú's senior vice president for risk and compliance, said in August. Itaú is Brazil's largest bank by market value.

The sluggish economy should drive margins at Bradesco down somewhat before year-end, Chief Financial Officer Luiz Carlos Angelotti said in July.

At Banco do Brasil, revenue gains hinge more on faster loan disbursements for farmers than, for instance, extending credit to debt-laden consumers and cautious businesses, CFO Ivan Monteiro said.

But there might also be another reason to cheer for Brazil's top three banks.

They face no immediate pressure to raise capital, bolstering share prices in the short run, said Pedro Fonseca, an analyst at BES Securities. In his view, 2015 will be a "transitional year" in which lenders must adapt to a potentially tougher outlook in the second half of the decade - namely lower interest rates and more competition.

Fonseca expects domestic rates to start declining again in 2016, hindering banks' ability to charge more for loans. As a result, he sees lenders doubling down on controlling costs, boosting sales of financial services and, as Itaú has done, expanding outside Brazil.

(Editing by Todd Benson, Kieran Murray and Cynthia Osterman)

By Guillermo Parra-Bernal