Ms. Rousseff is battling to stay in office, with protesters demanding her ouster and lawmakers pursuing impeachment proceedings against her. Demonstrations calling for her to resign flared Wednesday night in cities including Brasília and São Paulo.

But the people aspiring to replace Ms. Rousseff are under threat, too. The heads of both houses of Congress are being investigated for their roles in the national oil company scandal. The leader of the opposition Social Democrats is under fire over revelations that his family maintains secret bank accounts in Liechtenstein. Even the low-profile vice president, who has been positioning himself to take over if Ms. Rousseff is impeached, is under scrutiny over allegations that he was involved in an illegal ethanol purchasing scheme.

“Brazil has turned into an aspiring banana republic,” said Josias de Souza, a political commentator, pointing to the unusual situation of a sitting president handing over important functions to a besieged mentor.

Brazil, he said, is being “governed by a joke.”

Prosecutors are trying to have Mr. da Silva arrested in a corruption case that centers on his ties to giant construction companies. But cabinet ministers are among the 700 or so senior officials who enjoy special judicial standing, meaning they can be tried only by Brazil’s highest court, the Supreme Federal Tribunal.

Effectively, this prevents nearly all of these figures from going to prison because trials at the court drag on for years. Nearly a third of the 594 members of Congress, including the leaders of the lower house and the Senate, are under scrutiny before the court over claims of violating laws.