There are times when national and sporting narratives seem almost to be perfectly synchronised. America’s success at the 1984 Los Angeles Olympics, which presaged the Reagan landslide later in the year, offered golden proof that the country’s long national nightmare of Vietnam and Watergate had finally come to an end. The 2008 Beijing games confirmed China’s rise, and became a curtain-raiser on the Asian Century. What’s been noticeable this year, however, is the disconnect between the politics and sport of the game’s two most successful countries, the USA and UK, which came first and second in the medal table.

Britain voted to leave the European Union partly because of fears about immigration. Yet its hero of the Rio games, as in London four years earlier, was Mo Farrah, a Somali-born athlete who has emerged over the past four years as the face of British multiculturalism. Brexit has fuelled Scottish nationalism, because voters north of the border wished to remain within the European Union, yet it was the Scottish tennis player Andy Murray, who favoured independence, who carried the Union flag at the opening ceremony in Rio.

Across the Atlantic, Donald Trump, in promising to make America great again, has repeatedly said that the US doesn’t win anymore. Yet Team USA dominated on the track, in the pool and at the gym. It came away with its biggest medal trawl since 1984, when its tally was artificially inflated by the Eastern bloc boycott. In the run-up to Rio, America witnessed its worst racial tensions since the Los Angeles riots of the early-1990s. Yet it was the wondrous Simone Biles, a 19-year-old African-American gymnast, who stole the country’s heart, and hoisted the Stars and Stripes at the closing ceremony.

In Britain and America, the Olympics have inevitably aroused patriotic and jingoistic sentiments. On both sides of the Atlantic, this has been a fortnight of feel good fun. But will Rio produce more lasting feelings of unity, togetherness and commonality?

The extraordinary success of Team GB has brought about national rejoicing but not necessarily national unity. Rather, Rio has become a proxy battleground for Remainers and Brexiteers. 'Team GB’s Olympic medal haul is a blissful break from Brexit blues,' read a headline in The Guardian, playing to type. 'Britain’s Olympic success and post-Brexit vim are cause for celebration not cringe,' read an equally predictable headline in The Daily Telegraph. The Independent, focusing on the implications of a possible economic downtown on the funding of elite sport, asked: 'Could this be Team GB’s last great Olympics after Brexit?' When the anti-EU campaign group Leave.EU posted Tweets using the images of victorious British athletes to make a point about the UK’s national self-sufficiency, Team GB threatened to sue.

In other words, Rio gave the protagonists in the referendum something new to argue over. It also demonstrated the impossibility of conducting any kind of national conversation in Britain without it being dominated by Brexit. This will also be true, no doubt, when the flame is lit in Tokyo in four years time, and also in 2024, which two EU countries, France (Paris) and Italy (Rome) are competing to host.

So what of the USA? Has America’s Olympic success got a political dimension? Judging by the presidential candidate’s use of their social media accounts, it would seem that Hillary Clinton believes that Team USA’s feel good success is far more useful to her candidacy than Donald Trump. As Politico reported, the billionaire has been almost Trappist in his silence about the Olympics and America’s great success. His nativism also seems at odds with such an obviously multi-cultural Team USA, a group of athletes that looks like the country it represents.

What’s been striking about the advertisements airing in America during the Olympics is how many of them feel like rebuttals of Donald Trump. Coca Cola has run an ad called 'Together is beautiful' featuring Americans in hijabs as well as cowboy hats. Mini’s 'Defy Labels' features the American fencer Ibtihaj Muhammad, who says 'Muslim' down the barrel of the camera. Apple’s ad 'The Human Family' feels like a Benneton ad on steroids and features a poem read by Mayo Angelou, who took part in Bill Clinton’s inauguration. This has been a terrible few weeks for Donald Trump, and the Olympics, while not being the primary or even the secondary cause, have not helped. Clearly, America is great when it comes to sport.

As for the question of will the Olympics forge a greater sense of national togetherness, I suspect not. Somewhere, soon, there will be another multiple shooting, another racial flashpoint, another moment in the campaign that exposes that polarisation that is now a permanent feature of American politics. The Olympics was about red, white and blue success, but the broken politics is more about the deep divisions between red and blue.