High Court hears alleged government failures threaten residency rights of millions of Europeans living in the UK