A senior British supreme court justice has made a veiled attack on Donald Trump's hostility towards the US judiciary in a speech defending the independence of UK judges mauled by the media over their Brexit judgment.