The first thing that struck me during a trip to Cuba this month was how much it reminds me of Iran. Despite divergent ideologies—Communist, Islamic—the aging revolutions emit the same cranky melancholia. Rhetoric is still defiant, but public zealotry has atrophied. The graffiti of rebellion, once vibrant, has faded.

In Old Havana, only part of a popular street painting of Che Guevara, with his long locks and trademark beret, has survived the years; his washed-out mouth and mustache have been filled in with a Sharpie. In Tehran, billboards of the early turbaned revolutionaries are so dull, from the sun and the decades, that they seem ghostlike.

In both countries, a decadent subculture—of booze or drugs and prostitution—flagrantly taunts revolutionary morality. During the worst years of Cuba’s Special Period, in the early nineties, after the Soviet Union’s collapse and Moscow’s cutback in aid, the government tolerated many forms of sex tourism. Rum is still so ubiquitous it’s referred to as Vitamin R. In Iran, prostitutes, in chadors, made a comeback in the nineties. More than 1.3 million Iranians today are addicted to opiates, the U.N. reports. Liquor is outlawed, as a crime against God, but this year the theocrats announced plans for a hundred and fifty alcohol-rehabilitation centers.

Despite decades in power, both regimes are strikingly insecure and suspicious. Intelligence police are pervasive. Time is catching up with them politically as well. Their first generations of leaders are geriatric. There’s a constant undercurrent: What’s next?

In Cuba, the ailing Fidel Castro will be ninety in the new year; his brother Raúl, who succeeded him in 2008, is eighty-four, and has vowed not to seek reëlection in 2018. Speculation about successors includes Raúl’s outspoken daughter Mariela, the director of the Cuban National Center for Sex Education and a gay-rights activist; and First Vice-President Miguel Díaz-Canel. But few have a clue what’s likely to happen.

In Iran, the revolutionary leader Ayatollah Ruhollah Khomeini, who died in 1989, would have been a hundred and thirteen this year; his successor, Ayatollah Ali Khamenei, is seventy-six. Iranians go to the polls in February to elect a new Assembly of Experts, which will pick the next Supreme Leader from its eighty-six members when the current one dies. Khomeini’s grandson Hassan, a noted reformer, declared this month that he’s running for the Assembly; hard-line candidates are contenders, too. Again, few really know who’s likely to be next.

Economic failures are conspicuous in both capitals. Many architectural treasures are badly in need of paint. Neither country can sustain public subsidies of life’s basics—food, fuel, utilities, education, and health care—for the “oppressed” in whose name the revolutions were undertaken. Both regimes are encouraging private enterprise, without admitting that their ideal states can’t deliver.

Arguably, both revolutions have achieved their greatest successes in educating the populace—to the point where a telling number of their citizens want to leave. Literacy in both countries now exceeds eighty-five per cent, and leaps above ninety per cent among the young—higher than in many countries in the Caribbean or the Middle East. The majority of the university population in both countries is female. But both genders are underpaid and underappreciated for their knowledge and skills. Neither Havana nor Tehran has been able to stem the brain drain.

The ultimate similarity may be their twin tensions with the United States. The revolutions in Cuba, in 1959, and Iran, in 1979, were as much a reaction to American influence as to the unjust and corrupt rule of autocrats. They have survived ever since, partly off their showdowns with Washington.

When I visited the Bay of Pigs Museum, in December, its walls were lined with photographs of “martyrs” who died fighting the clumsy C.I.A.-backed invasion, in 1961, and the subsequent mass trial of captured “mercenaries.” The halls and grounds were filled with captured American weapons and vintage Soviet tanks used to counter them.

In May, I visited the old U.S. Embassy in Tehran. It’s now a museum devoted to Iran’s tumultuous history with America, dating back to the C.I.A.-orchestrated 1953 coup against the democratically elected Prime Minister Mohammad Mossadegh, which put the Shah back on the throne. The “Den of Spies,” as it is dubbed locally, has rooms devoted to old espionage equipment and photographs of American hostages from the Embassy takeover, in 1979.

A commonality in both regimes’ survival is the nationalism those confrontations reflect. For all their woes, both societies are proud of their political independence. Cubans did not rise up against the Castro clan even during the tough Special Period in the nineties. A young Cuban explained to me the current nostalgia over Fidel’s speeches, which once kept his people in the hot sun for hours. Millions of Iranians protested alleged fraud after the 2009 Presidential elections, but the majority turned out to vote in the 2013 Presidential contest. A young critic told me this year that, despite pervasive grumbling, if Iran held a free and fair referendum on Islamic rule a simple majority would probably support it.

Yet both Havana and Tehran began coming to terms with their nemesis this year. Part of the policy shift is a response to advanced age, an attempt to insure more years in the political life cycle. A mix of pragmatism, reality, and necessity contributed. Neither revolution is on the cusp of collapse. But both are aware that the largest communities of Cuban exiles and Iranian exiles are in the United States—one reason there’s better Cuban food in Miami than in Havana and finer Persian cuisine in Los Angeles than in Tehran.