They could always study somewhere cheaper to live. For example Dundee.
Edinburgh is popular not just because of good universities, but also it's a city destination. It's a supply and demand thing that sets the price of rentals, surely?
Universities realise that Edinburgh is an attractive city to study in, and target increasing numbers of RUK/non-EU students, it's a way to generate more fees income. Funded places for Scottish/EU students are capped.
So ultimately the universities are at least partly to blame for a cost of living crisis for students in the city.