It is a tale of two New Yorkers. Donald Trump goes to Germany to defend Western civilization and promote economic growth. Bill de Blasio goes to Germany to throw verbal Molotov cocktails and promote socialism.

One is the leader of the free world, the other is a great pretender.

The mayor was in full Putz mode as he abandoned his City Hall post to join the anarchists, socialists and violent leftists trying to disrupt the G-20 summit. In the history of low moments in New York politics, de Blasio’s stunt stands out.

His decision to join an international rabble marked by vandalism and violence to “protest” Trump, the head of his own country and a citizen of his own city, shows where the mayor’s heart is.

Politically, it’s foolish — the city needs federal cash, and biting the hand that feeds is never wise.

Yet wisdom eludes de Blasio. He came of age with a fondness for Fidel Castro and the murderous Sandinistas, and refuses to grow up.

He kept his trip a secret until he was leaving, knowing he would be denounced. So he skulked out of town in the aftermath of a police assassination, the slow-motion collapse of the subways and a record surge in homelessness.

For what? To talk about climate change and gay marriage to foreigners nearly 4,000 miles away.

George Will has called such posturing “moral grandstanding” and argues that, for modern liberals, “feeling good about themselves” is the central goal.

Self-congratulation certainly was high on the mayor’s agenda. He boasted to his hosts about the diversity of New York subway riders, as if that just started on his watch.

The timing was especially awkward given that those subway riders are united in their fury about decrepit service. Far be it from de Blasio to do anything about it except grab a freebie trip to Europe and talk, talk, talk.

Defending his decision to bolt, the mayor called a city radio show to insist that “all the issues that need to be attended to, I am attending to . . . regardless of where I am.”

He has it exactly backward. He should have stayed in New York and phoned in his cliched remarks to Germany. By doing the opposite, de Blasio shows he has checked out of his day job in hopes of getting a better one.

He should thank his lucky stars if he keeps the one he has.

In the last 60 years, voters fired just two mayors after a single term, and in both cases the city faced a staggering crisis. Abe Beame got the boot over the brush with bankruptcy, and David Dinkins was replaced as crime soared and the quality of life plummeted.

There are no comparable emergencies facing Gotham now, but de Blasio is testing the assumption that he can coast to re-election in November. Perhaps his sneaky disappearing act will persuade enough voters that it’s time to find an alternative.

Until they do, they’re stuck with a mayor who neglects their cares to become a pet rock of the international left. In his phone call, he said his role was to “set a tone and say we are not going to be intimidated by President Trump.”

Under that definition of his job, New York can go to hell and it’s not his problem. He’s got more important things to do.

In contrast to the mayor’s embarrassing trip, Trump was on a serious mission to combat terrorism and shape international trade rules to create more jobs for Americans. As he had in his Mideast visit, where he rallied Muslim nations, the president demonstrated a strong sense of purpose about confronting global threats to freedom.

Most important, Trump this time placed that fight in the context of defending Western civilization itself.

“The fundamental question of our time is whether the West has the will to survive,” he said in his remarkable speech in Warsaw. “Do we have the confidence in our values to defend them at any cost?

“Do we have enough respect for our citizens to protect our borders? Do we have the desire and the courage to preserve our civilization in the face of those who would subvert and destroy it?”

The references to values and borders were a smash with ordinary Poles, but didn’t sit well with the sloppy secularists and socialists leading Europe to ruin. No doubt de Blasio hated it, too.

Good — that was the point.

Unlike his predecessor, Trump doesn’t travel to apologize for America and surrender to multi-cultural sensitivities. He was elected to slam the brakes on the poisonous ideas that redistribution of wealth and managing decline are the president’s chief duties.

What exactly he will do instead remains a work in progress. Yet gradually, and sometimes by fits and starts, Trump’s America First agenda is emerging as a coherent doctrine that sees faith and family as a bedrock of national peace and prosperity. And those, in turn, are key to his vision of American global leadership.

As he put it in closing in Warsaw, we are engaged in a battle “for family, for freedom, for country and for God.”

Naturally, much of the media obsessed about whether the president would confront Vladimir Putin about Russian attempts to meddle in last year’s election, but they got more than they bargained for when Trump first used a press conference to accuse then-President Barack Obama of doing nothing about Russia because he assumed Hillary Clinton would win the election.

Though you wouldn’t know it from the horrified media reaction, Trump is right. Jeh Johnson, Obama’s head of homeland security, admitted as much to Congress, saying Trump’s early warnings of a “rigged” election made the White House nervous about going public on Russia because it might appear Obama was trying to unfairly tip the race to Clinton.

Trump did raise the meddling issue with Putin, though he gets no credit from the usual suspects. Whether he was forceful enough remains to be seen, but it was important to confront Putin in the context of pushing back against Russian aggressions elsewhere.

No matter the country, Putin only stops when he’s stopped.

The announced cease-fire in Syria is a sign their talks were substantive, but it’s a fool’s errand to judge from one meeting whether America and Russia can have a productive relationship. For now, the most important outcome would be a mutual decision to pull back from the escalating cycle of confrontations before the two greatest superpowers stumble into military conflict.

Ultimately, Trump’s presidency depends on his success at home, and he returns to grim talk that the Senate will not pass an ObamaCare replacement bill.

The news reveals that Republicans still haven’t figured out how to govern. Getting his party over that hump must now become the president’s chief focus.