President Obama and Cuban President Raúl Castro at the United Nations headquarters on Sept. 29. (Andrew Harnik/Associated Press)

At the heart of President Obama’s foreign policy is a long bet: that American engagement with previously shunned regimes will, over time, lead to their liberalization, without the need for either a messy domestic revolution or a bloody U.S. use of force. By definition, it will be years before we know whether the policy works.

It nevertheless is becoming clear that the regimes on which Obama has lavished attention have greeted his overtures with a counter-strategy. It’s possible, they calculate, to use the economic benefits of better relations to entrench their authoritarian systems for the long term, while screening out any liberalizing influence. Rather than being subverted by U.S. dollars, they would be saved by them.

So far, the dictators’ bet is paying off. The latest evidence of that came Sunday in Burma, when the generals who still rule the country staged an election carefully structured to preserve their power. The constitution under which it was held bans opposition leader Aung San Suu Kyi from becoming president and reserves a quarter of parliamentary seats for the military.

Obama might claim that the lifting of U.S. sanctions and the two trips he made to the country helped prompt this limited democratic opening. The generals see it another way: The restricted system, and the inflow of U.S. and European investment it enables, makes their political supremacy sustainable for the long term. As proof, they can point to the fact that they rebuffed U.S. appeals for constitutional reforms before the election with no consequence for the new economic relationship.

That Iran’s supreme leader is pursuing a similar course became clear in recent days as the arrests of two businessmen with U.S. citizenship or residency came to light. Having allowed reformist president Hassan Rouhani to negotiate the nuclear deal with Obama, Ayatollah Ali Khamenei and the Revolutionary Guard intend to pocket the $100 billion or so in proceeds while forcibly preventing what they call the “penetration” of Western influence that Obama hopes for.

Hence the taking of more U.S. hostages. To the imprisonment of The Post’s Jason Rezaian and two other Iranian Americans, add Nizar Zakka, a U.S.-based Internet specialist, and Siamak Namazi, an Iranian American who has publicly advocated for better relations between the countries. The lack of any U.S. response means that the open season on Americans will continue in Tehran.

Khamenei, however, doesn’t get the prize for the best jujitsu on Obama. That goes to Raú l Castro, the 84-year-old ruler of weak and impoverished Cuba, who has managed to transform the resumption of U.S.-Cuban relations into an almost entirely one-sided transaction.

Since announcing the end of the 50-year freeze between the countries 11 months ago, Obama has twice loosened restrictions on U.S. travel and investment in Cuba. Thanks to that, tourism arrivals are up 18 percent this year, and billions in fresh hard currency are flowing into the regime’s nearly empty treasury. The White House has dispatched a stream of senior officials to Havana, including Commerce Secretary Penny Pritzker. The deputy secretary of homeland security, Alejandro Mayorkas, last month paid court to the general who heads Castro’s repressive internal security apparatus.

In response to this, Castro has done virtually nothing, other than reopen the Cuban Embassy in Washington and allow a cellphone roaming agreement . His answer to repeated pleadings from U.S. officials for gestures on human rights has been to step up repression of the opposition. According to the independent Cuban Commission for Human Rights and National Reconciliation, there were at least 1,093 political detentions in October, the highest number in 16 months.

Castro has meanwhile shunned offers from U.S. businesses and dramatically cut U.S. imports. Pritzker did not sign a single deal during her high-profile visit last month. Instead, Cuban officials are using the prospect of increased U.S. trade and investment as “chum” to strike bargains with other countries, according to a report by the U.S.-Cuba Trade and Economic Council. While imports of U.S. food are down 44 percent this year, imports from China are up 76 percent.

Remarkably, the administration appears happy to accept this. The latest high-level envoy, State Department senior adviser David Thorne, told Reuters in Havana last week: “The pace is really going to be set by the Cubans, and we are satisfied with how they want to do this.” What about the lack of progress on human rights? “As in other parts of the world,” Thorne grandly replied, “we are really trying to also say: Let’s find out how we can work together and not always say that human rights are the first things we have to fix before anything else.”

So the message is: It’s okay to capture U.S. dollars while excluding U.S. business and cracking down on anyone favoring liberalization. No wonder the dictators are winning.

Read more from Jackson Diehl’s archive, follow him on Twitter or subscribe to his updates on Facebook.