The UN’s highest court has urged the UK to end its control of the Chagos Islands in the Indian Ocean “as rapidly as possible.