SAO PAULO — In 2012, Brazilian prosecutors accused Marcos da Rocha Mendes of handing out meat and 50 real ($15) bills to secure the 2008 mayoral election in Cabo Frio, a city on the country's southeastern coast.

A regional electoral court accepted the charges in 2013. But the case has subsequently been shifted to a lower court and then up to Brazil's Supreme Federal Tribunal, which began discussing it last year. Six years after charges were filed, the country's highest court is now deciding if the case should be bounced to yet another tribunal.

This is Brazil's "foro privilegiado," or "privileged standing," at work — the legal concept that gives nearly 55,000 sitting politicians the right to have cases against them heard by a higher court. It's meant to protect officials from politically motivated prosecutions by putting their cases in front of more experienced judges, but in Latin America's largest nation it has effectively shielded senior politicians from conviction even as the country has made enormous strides against impunity in its watershed "Car Wash" corruption investigation.

"It's exactly people who are the most exposed to the risk of corruption, of illegal activities contrary to the public interest, who are protected by this system," said Bruno Brandao, executive director of Transparency International in Brazil. "It's an engine of impunity in Brazil."

The Supreme Federal Tribunal's ruling in Mendes' case could change all that — by dramatically limiting the current generous interpretation of privileged standing and thus potentially exposing politicians to much swifter justice.

The ruling could come as soon as Wednesday, although justices at past sessions have asked for more time to analyze the issue. So far, eight of the court's 11 justices have made a preliminary vote in favor of some kind of restriction.

Limiting privileged standing would be a major boost to the mammoth Operation Car Wash probe, in which prosecutors have alleged that Brazil's government was effectively run like a cartel for years, with politicians doling out favors and state contracts in exchange for bribes and campaign contributions. The investigation has shaken Brazil's political system and put dozens of powerful people in jail, including some of the country's richest men.

But despite Car Wash's successes, senior politicians who have the right to have their cases heard at the Supreme Federal Tribunal have been conspicuously absent from the probe's record. Instead, many of the corruption investigation's most famous defendants have been business executives.

That's at least partially because of privileged standing, which leads cases against politicians to languish in the justice system because every time a defendant changes jobs, his standing changes and the case moves to a new court.

In the four years since the probe began, the Supreme Federal Tribunal has yet to hand down a single verdict in a Car Wash case. By contrast, regular trial courts have convicted 160 defendants, according to the federal prosecutor's office. Two of those convicted are former President Luiz Inacio Lula da Silva and former Speaker of the House Eduardo Cunha, who were once among Brazil's most powerful politicians but lost their privileged standing after leaving office and were tried in regular courts.

Proponents of eliminating or restricting the privilege highlight a few ways in which it gums up the legal system and results in cases against senior politicians languishing for years.

The privilege currently applies to every kind of infraction — from breaking budget rules to murder. Its application also depends on a defendant's current office, not his or her status at the time of an alleged crime. That leads to what is known as the "legal elevator," on which cases move up and down the hierarchy of courts as politicians change offices.

That is what happened to Mendes, who was a mayor when he was first charged, but then left office and later became a federal legislator. With each job change, his case switched courts. He is now a mayor again and so the Supreme Federal Tribunal, which hears cases against federal lawmakers, is likely to rule he no longer has standing there.

Justice Luis Roberto Barroso, who is overseeing Mendes' case at the high court, calls privileged standing a disaster for Brazil. He says the "system is designed to not function."

Barroso contends unscrupulous politicians have learned to play the game of venue-shifting: If a case looks like it is advancing at the Supreme Federal Tribunal, a lawmaker might resign his position, forcing the case back to a lower court and starting the clock all over again.

Critics of the privilege also argue it's too broad. Tens of thousands of politicians who benefit can have their cases heard at higher-level courts than those where cases against ordinary citizens begin.

The heart of the problem, however, is the more than 850 politicians — mostly federal lawmakers — who have the right to be heard at the Supreme Federal Tribunal. The privilege aggravates an already heavy case load at Brazil's highest court, which received more than 100,000 cases last year and published more than 13,000 decisions. By contrast, the U.S. Supreme Court is asked to hear about 7,000 cases each year and rules on between 100 and 150.

The result is that trials for Brazil's most senior politicians end up moving extremely slowly — and often the statute of limitations expires before a judgment is reached.

The privilege is written into Brazil's constitution, so only an amendment can reduce the number of politicians it applies to. One such amendment is making its way through Congress, but it's unclear if federal lawmakers — at least 40 percent of whom are facing investigations — will be willing to pull the rug out from under themselves.

In the meantime, Barroso has proposed limiting the privilege in the court's upcoming ruling so that it applies only to alleged crimes committed during a politician's time in office and connected to the exercise of that office's duties. A report by researchers at Fundacao Getulio Vargas university found that 95 percent of the cases with privileged standing sent to the Supreme Federal Tribunal between 2007 and 2016 would have gone to lower courts under this interpretation.

"This would be a huge blow against impunity," Brian Winter, editor-in-chief of Americas Quarterly magazine, said of the possibility of the court limiting the privilege. "It would greatly reduce the number of people who are able to just stall and delay their trial into eternity."