What these two universities have in common is that they were both established at roughly the same time in the 1960s. They are both campus universities located on the outskirts of relatively small, historic cities and they both regularly feature in the top 20 or so of the various UK rankings. York is also in the Russell Group, if you see that as significant. Lancaster, on the other hand, has a higher ranking for Marketing - a very creditable 4th in the 2024 Complete Universities Guide.
Lancaster is pleasant enough but it's fair to say that it cannot compete with York as a city; the latter is far larger and is a vibrant tourist destination all year round. That does, however, make accommodation expensive and sometimes hard to come by.
Your best approach is to visit both if possible or, if not, do a thorough Google Earth search to try and get the feel of both. Most important of all, look at the details of each course you are applying for and check both module options and assessment methods ( how many exams, for example). Note that York now has a semester system rather than the traditional 3 term year: that might influence your choice.
In the final analysis, you can't go far wrong with either.
(York Masters graduate, frequent visitor to Lancaster).