The inauguration of Andrés Manuel López Obrador (AMLO) as president of Mexico will soon be followed by Brazilian President-elect Jair Bolsonaro’s inauguration, as well as US President Donald Trump’s completion of two full years in office. Though each is a unique event, they share some essential features. Most important, each represents a political outcome that could have been avoided.

Since the fall of the Berlin Wall, representative democracy seemed to be on a roll in much of the world. Democratic governments replaced dictatorships across Latin America, Africa, and parts of Asia, and they were supported by a united front of older democracies in the North Atlantic. But this all began to change in just the past few years.

From Hungary and Poland to Italy and even Germany, emerging political forces are challenging democratic governance. Though today’s resurgence of populist nationalism may peter out, for now it must be viewed as a serious threat. Much of this was foreseeable, and could have been prevented if those who should have known better had not remained passive.

Nowhere is this truer than in the United States, Mexico, and Brazil. Though AMLO hails from the left, while Bolsonaro and Trump are of the right, all three are indifferent to – if not contemptuous of – democratic processes. Trump, for example, has already undermined the norms of democratic rule in the US, if not through substantive policy, then certainly with his rhetoric.

Between issuing scurrilous charges of non-existent voter fraud, openly encouraging his fellow Republicans to engage in voter suppression, and inviting foreign powers to launch cyber attacks against his opponents, Trump has undermined the credibility of US elections. His attempts to weaken asylum protections, along with his imposition of a religiously motivated travel ban, represent a rejection of core American values. His politicization of the judiciary and attacks on the press are clearly driven by a desire to remove all checks on his power.

For his part, AMLO has spent his transition period introducing pro forma ballot initiatives to reverse major decisions such as the construction of a new airport outside Mexico City. In holding that referendum, he and his party bypassed the official institutions that oversee Mexican elections, not only selecting the polling sites themselves, but also counting the votes. When it was announced that the initiative had indeed passed, no one was surprised, and the Mexican peso plummeted against the dollar.

More recently, legislators from AMLO’s party railroaded a measure through Congress that militarizes Mexico’s only national civilian police force. Whereas AMLO had previously promised a new strategy in the war on drugs, he has now doubled down on the approach pursued by his predecessor. The military will remain in the streets, but their uniforms will be a different color. Most threatening of all, AMLO has resorted to a Hugo Chávez-like strategy of installing handpicked proconsuls in each of Mexico’s 32 states. These loyal factotums will effectively sideline each state’s duly elected governor.

Bolsonaro, for his part, has announced that Brazilian police will have “carte blanche” to kill criminals. His goal is to militarize law enforcement throughout the country, and to make weapons widely available to the public. Like Trump, Bolsonaro has practically declared war on several media outlets, especially Folha de S.Paulo, Brazil’s largest-circulation newspaper.

Also like Trump, Bolsonaro has unleashed a litany of racist, sexist, homophobic, and nativist comments that should not be dismissed as mere bluster. There is every reason to believe that at least some of his statements will translate into policy once he is in power. With five former generals in Bolsonaro’s cabinet, Brazil’s government will have more senior officers than at any time since the end of the military dictatorship in 1985.

Though Bolsonaro’s justice minister, Sérgio Moro, is a widely admired judge who led the Lava Jato (“Car Wash”) anti-corruption drive, he alone cannot compensate for this level of militarization. And besides, his credibility has been called into question by his role in barring former President Luiz Inácio Lula da Silva from running in the election that Bolsonaro just won.

Could all of this have been avoided? In the case of the US, remember that in the summer of 2016, “Never Trump” Republicans called for a rule change that would have allowed delegates at the Republican National Convention to vote their “conscience” instead of in accordance with state primary results. But the party’s rules committee rejected the proposal out of fear of angering the Republican base.

As for Brazil, many had warned before the first round of the presidential election on October 7 that only Lula could defeat Bolsonaro in a run-off. But in early September, Brazil’s electoral court ruled that Lula’s previous conviction on (dubious) corruption charges disqualified him from running. Despite the fact that the court had given Bolsonaro a clear path to victory, Brazil’s democrats stayed quiet, rather than rallying behind Lula.

Finally, in Mexico, it was obvious beforehand that AMLO would win by a landslide and secure a congressional super-majority if the other parties did not band together. That would have required the third-place contender, José Antonio Meade of the Institutional Revolutionary Party (PRI), to drop out and endorse the second-place candidate, Ricardo Anaya of the National Action Party. But neither the PRI nor Mexico’s business community and intelligentsia could agree to proceed accordingly.

As a result, the US, Brazil, and Mexico find themselves facing the same problem. And democrats in all three countries will not solve it unless they come together in defense of democracy, even if they disagree on basic policy issues. That means standing up to the authoritarian drift through whatever democratic means are available. Caving in on judicial appointments, major public works projects, and proposals to “arm the people” is not a winning strategy. Those who still believe in democracy must take their case everywhere: to voters at home as well as to friends and allies abroad. In these unhappy times, democrats will sink or swim together.