Brazil has got itself into a terrible mess and it is difficult to see how it will get out of it. The senate’s vote this week, following that of the lower house last month, means President Dilma Rousseff is suspended from office and will go on trial on charges of manipulating the country’s finances to gain electoral advantage. That the story of the country’s first female president, known for her part in the resistance to the military dictatorship which ruled the country until 1985, for her steadfastness under torture in those days, and for her long association with Luiz Inácio Lula da Silva, Brazil’s most popular leader in modern times and her predecessor as president, should have reached this point is a personal tragedy for her.

Her own faults, which even her defenders concede are substantial, contributed to her downfall. But what is clear is that it is not only her career that has crashed, but the Brazilian democratic system as a whole. Dysfunctional to the point where corruption is virtually unavoidable and good governance constantly impeded, it worked, just about, in the skilled hands of Lula during a period of lively economic growth. Lula could finesse its inadequacies and manage the complex coalitions to which it gave rise. However, he resorted to corruption to do so.

Dilma inherited this unhappy legacy and began to lose control during a period of economic decline, as corruption, thanks to independent police and prosecutors, was becoming a scandal of increasing proportions. Male prejudice against a female leader, and the grudges of a political right never wholly reconciled to the rise of Lula’s and Dilma’s Workers’ party (PT) certainly played their part. The final toxic element in the crisis was the realisation by many politicians that prosecutors could soon catch more and more of them in its net, and that a way to avoid or minimise this possibility would be to distract attention and take control of the political process by pursuing the impeachment of the head of state.

The rights and wrongs of the case against the president will be debated in the senate, acting as a court. It involves, at this stage, no charges of corruption, while a considerable number of those who voted for impeachment have either been charged or are facing investigation for that offence. The irony is plain to see, when so many of the accusers are themselves accused, and of worse sins. For example, Eduardo Cunha, the speaker of the lower house, who orchestrated the campaign to impeach the president, was earlier this month ordered to step down because he faces a corruption trial.

Who should be on trial and who should not is an important question. But what should be on trial, above all else, is the failed Brazilian political model. The Brazilian constitution detaches executive power from the legislature but also, through the way it counts votes for congress, gives rise to a plethora of political parties. The result is that a president who has received a majority of the popular vote faces a legislature in which his or her party is lucky if it has 20% of the seats.

To rule, the president must do deals that hamper policymaking and hand thousands of government jobs to the often incompetent nominees of political parties. To make matters worse, even the big parties cannot raise enough money from legitimate sources for campaigning in a huge country with many levels of government. Brazilian elections are almost as expensive as US ones.

Where it found the cash was always a murky question. But when a bonanza in the shape of kickbacks from contracts with Petrobras, the state oil company, came along, the PT, followed by politicians of almost every stripe, took swift advantage. A new Brazilian administration ought to initiate radical constitutional changes that would make politics both more workable and more honest. But whether the new government that the vice-president, Michel Temer, is assembling will be capable of such a leap is, unfortunately, very doubtful.