In the 25 years since it became a democracy, Poland has emerged as one of the biggest successes of the post-Cold War era, serving as an example of what President Obama and Western leaders say can happen when a country embraces democratic governance and a robust market system.

But on the eve of a visit by Obama on Tuesday, the Eastern European country also stands in stark contrast to its troubled neighbor, Ukraine, whose reliance on oligarchs and a rigid system of state-run industries left its economy weak and its political system tenuous after the dissolution of the Soviet Union.

Russian President Vladi­mir Putin exploited that vulnerability this year by annexing the region of Crimea and stirring unrest in eastern Ukraine. Many experts say the important question now is whether the United States and its Western European allies can coax Ukraine into following Poland’s model.

“If you look at Poland and Ukraine 25 years ago, they were not all that dissimilar. If you compare them today, they’re not remotely similar,” said Karen Donfried, president of the German Marshall Fund of the United States. “This path that Poland has followed has been hugely successful. That’s quite powerful.”

During his two-day visit to Warsaw — the beginning of a week-long trip to Europe — Obama will take part in a series of meetings with Poland’s leadership and events celebrating the success of the Solidarity movement, co-founded by Lech Walesa, in helping to produce the country’s first partially free elections on June 4, 1989. Obama is expected to give a high-profile address Wednesday marking the anniversary.

Both the Americans and the Poles describe the meetings as a moment for Obama to reaffirm America’s commitment to the defense of Poland and other Eastern European allies. But it’s not yet clear whether the U.S. and its Western European counterparts will have the sustained attention — and the resources — to lift up Ukraine and other countries vulnerable to Russia’s influence.

With its own budget constrained by domestic fiscal battles and gridlock, the United States has been trying to focus on other foreign policy priorities, primarily in Asia, while reducing its spending in Europe. And in Western Europe, voters are showing little enthusiasm for enlarging the Euro project — as evidenced by the success of far-right parties in elections last month.

The United States and Western Europeans have still offered billions of dollars in aid and loan guarantees to Ukraine — mostly through the International Monetary Fund. And on Monday, the White House announced that Vice President Biden would travel to Ukraine this week for the inauguration of Ukrainian President-elect Petro Poroshenko, who is set to meet with Obama in Warsaw earlier in the week.

But Fiona Hill, director of the Center on the United States and Europe at the Brookings Institution, said a reform program for Ukraine, with a population of 45 million, might have to be comparable in size to that which was deployed to reincorporate East Germany into West Germany. Reunification, beginning in 1990, took more than a decade and cost more than a trillion dollars.

“Twenty-five years later, the appetite for taking on those huge economic transformations is no longer there,” Hill said.

Poland prospered in the 1990s and 2000s thanks to decisions made by its own leadership and the support of U.S. and Western European allies. After a brutal period of economic decline and civil unrest in the 1980s, the country began to turn the corner after the 1989 elections.

Using a strategy that economists called “shock therapy,” Poland dramatically overhauled its economy, eliminating government price controls, shrinking the public sector, liberalizing trade and relaxing currency control.

Ultimately, Poland joined the North Atlantic Treaty Organization in 1999 and the European Union in 2004. When the continent fell into financial crisis in 2009, Poland was the only E.U. nation to grow.

Over those two decades, however, Ukraine didn’t embrace the reforms that Poland did.

“The political crisis of the last six months began as an economic crisis and had its origins in decades of failed economic policies,” Robert Kahn, a senior fellow at the Council on Foreign Relations, wrote in a recent analysis. “Massive fuel subsidies going disproportionately to the wealthy, widespread corruption, and distorted markets all contributed to the rot.”

Even if the United States and Western Europe muster the support necessary to help Ukraine, many challenges remain. While Poroshenko’s relatively smooth election was seen as a positive sign, some observers doubt that, as a billionaire member of the country’s oligarch class, he will be able to usher in the reforms necessary to transform the country.

“The general feeling among Kiev’s intelligentsia is that the endemic corruption and bureaucracy that has smothered the political system for over 20 years will likely take a generation to fix and is at any rate unlikely to come from an ‘insider,’ ” author David Patrikarakos wrote in Foreign Policy magazine.

“The task ahead is just really difficult,” said Jan Techau, director of Carnegie Europe, the European center of the Carnegie Endowment for International Peace. “It’s a corrupt country. It’s a devastated country.” Russia is also actively trying to shape events in Ukraine.

“It’s a much more difficult environment today,” said Carl Gershman, president of the National Endowment for Democracy. “A much stronger pushback coming from Russia and other countries.”

Still, in a lesson of how difficult Ukraine would be, Poland, despite all its success, still craves U.S. support.

“In some ways Poland — 25 years older and wiser and much more propserous — embodies the insecurity of Europe,” said Eugene Rumer, a former intelligence official who now is director of the Russia and Eurasia Program at the Carnegie Endowment for International Peace in Washington.