Ms. Rousseff said that the men who conspired to topple her had done a dismal job and become ensnared in new corruption scandals. “It just so happens that their candidates and leaders are demolished,” she said, sounding pleased.

That dynamic, she said, has made Mr. Bolsonaro’s candidacy plausible, while also lifting the appeal of Mr. da Silva and the Workers’ Party, which took a hit during the economic recession and from the corruption investigations.

Mr. da Silva kicked off his campaign with a bus tour through the impoverished states in the country’s northeast, where many residents recall his time in office, which coincided with a commodities boom, as the most prosperous in their lives.

Maria de Fatima Oliveira, 53, a part-time assistant at a funeral home in Cansanção, a small town in the state of Bahia, said that without the subsidies she began receiving when Mr. da Silva was president, she could not have paid her electricity and gas bills.

Later, during Ms. Rousseff’s tenure, access to medical care expanded in the area with the arrival of Cuban doctors hired by the government on contracts.

“Here in the northeast, we’re Lula and Dilma supporters,” said Ms. Oliveira, who lives in an adobe house on a dirt road. “All politicians are thieves, but at least when they stole they also gave us back something.”

Mr. Bolsonaro has warned that a return to Workers’ Party rule would put Brazil on a ruinous path, pointing to the crisis in Venezuela as a cautionary tale. He has sought to portray himself as the rare experienced Brazilian politician untainted by corruption scandals, although a recent investigative report by a Brazilian newspaper on his real estate holdings raised questions about how he and his sons could have afforded apartments worth $4.6 million on public service salaries.