Ukraine is not yet lost. Yes, it's a gobsmacking reversal that Viktor Yanukovych, whose election fraud in Ukraine's 2004 presidential contest sparked the orange revolution, has now been elected president; but this is not the triumph of a blue counter-revolution. If anything, it confirms that Ukraine is becoming a serious democracy, rather than the Russian-type virtual democracy it was before the orange revolution. Unlike many so-called elections in authoritarian regimes, we did not know the result of this one in advance. Experienced international election monitors found it to be free and fair. Defeated princess Yulia Tymoshenko should not be disputing the result; she should be starting her campaign to win in 2015.

Yanukovych will seek a close relationship with Russia, but there is no evidence that the oligarchs behind him want Ukraine to cease being an independent country. Their interest is to play both sides, Russia and the European Union. Yanukovych himself now says that Ukraine's integration into the EU is "our strategic aim". For friends of freedom in Ukraine, there are five tough years ahead. Real threats to effective sovereignty remain, including Russia's use of the gas weapon and the possibility of a blow-up over the Crimean peninsular, where the majority of the population is Russian and Russia's Black Sea fleet commands Sevastopol. But if these potential storms are weathered, and Yanukovych is voted out in 2015, then future historians may yet see this as a zig-zag step on the path to the consolidation of an independent Ukraine. That will, however, require courage in Kiev, restraint in Moscow and strategic thinking in Brussels – qualities currently in short supply in the respective capitals.

As someone who witnessed the orange revolution in Kiev, and welcomed it enthusiastically, I must frankly acknowledge the disappointment that followed. Viktor Yushchenko turned out to be a pretty hopeless president, even before his hands were tied in power-sharing knots by the constitutional compromise that ended that revolution. Read the epilogue to the latest edition of Andrew Wilson's excellent history of the Ukrainians, and you find yourself in a world closer to The Sopranos than to The West Wing. Oligarchs tussle behind the scenes of politics like mobsters; corruption is endemic; the country has slid down the economic freedom index; the economy shrunk by more than 14% last year. Ordinary Ukrainians can enjoy speaking freely and choosing among the candidates – turnout in this election was close to 70% – but they have good reason to be disappointed by the lack of material improvement, legal security and social justice.

It's also true that over the last five years Ukraine has received less support from the EU than it should have. European leaders have been disgracefully mealy-mouthed about the prospect of Ukraine joining the union. Yet even the country's strongest advocates, such as Aleksander Kwasniewski, the former Polish president, have to acknowledge that the Ukrainians have often been their own worst enemies. Europe can't do for Ukraine what it won't do for itself.

In this respect, and for all her faults, the narrowly defeated Tymoshenko would have been better. Even by the low standards of post-communist politics, Yanukovych is a lumpen figure. A joke I heard in Kiev at the time of his candidacy in the 2004 presidential election asked: "Did you know that Yanukovych is seeking a third term?" His first two terms were in prison, as a very young man, for robbery, grievous bodily harm and sexual assault. Well, now he's got that third term. Despite a heavy work-over by the American political consultant and "alpha dog" Paul Manafort, his speeches are heavy as suet. I like the story that he referred to the great Russian poet Anna Akhmatova as Anna Akhmetova (his main oligarch godfather being Rinat Akhmetov). The only silver lining is that, like so many other leaden and inarticulate leaders in the post-­communist world, he will surely mobilise young Ukrainians in embarrassment, disgust and ridicule.

Anyway, Yanukovych is the best Ukrainian president we've got. We have to work with him. The question now is what we in the European Union can do to help Ukraine towards a more free, prosperous and European future. This is a question particularly to one EU diplomat who, it occurs to me, has been chosen for exactly the same term in office as Yanukovych, and whose own pronouncements have so far been of truly Yanukovychian dullness. I mean, of course, the high representative for foreign policy, Catherine Ashton.

The EU should move beyond its current weaselly language ("acknowledging the European aspirations of Ukraine and welcoming its European choice") to say, in terms, "we want you to be a member of the EU, when you satisfy all the conditions for membership. This is in our interest as well as yours." It will be hard work to get all the EU's national leaders to commit to that, but Ashton should start chipping away at it now. Five years in European politics is a long time.

Meanwhile, there is stuff she can start doing today. As she builds up the EU's new foreign service, she must decide where to concentrate diplomatic and financial resources. The places where the EU can have maximum impact are in our immediate neighbourhood, and few matter more than Ukraine.

Today the EU delegation in Kiev is a dreary, bureaucratic, low-voltage affair, with possibly the world's most boring website. Within a year, Ashton should turn it into a high-energy example of what an EU embassy can be, with a top-notch, politically astute ambassador, staff chosen from the best of the Brussels bunch and the diplomatic services of member states, fluent Ukrainian-speakers to appear in the Ukrainian media, and exemplary coordination with embassies of EU member states.

The EU's recently established joint cooperation initiative in Crimea should have a highly visible permanent presence on that troubled peninsular. Its officials should help all the peoples of Crimea (Russians, Ukrainians, Crimean Tatars and others) to get more of the things they badly need – better roads and ­infrastructure, educational and cultural ties. And by the way: if there were any serious trouble brewing there, we should know about it well in advance.

Although Yanukovych is likely to turn to Moscow for a special gas deal, Brussels should plug away at the need to have realistic domestic gas prices, more energy efficiency, and more diversified, better integrated supply networks. This is a vital European interest. Remember that when Russia turned off the gas going through Ukraine in January 2009, the eastern half of the EU caught a cold. Next year's Hungarian and Polish rotating presidencies of the EU would support Ashton and her fellow commissioners to the hilt in this endeavour.

As for ordinary Ukrainians, the single thing that would make the most difference to them would be the easing of visa restrictions. Anyone who saw the psychological impact in Serbia of last December's announcement of visa-free travel to the EU will know what I mean.

This is boring, slow, unspectacular stuff, but then, that's what the EU is good at. A tortoise should do what a tortoise can. I'm told it sometimes even beats a Russian hare.