This is because sunlight hits the Earth at more of an angle the farther north and south you get, so it passes through the atmosphere for a longer time and more UV gets absorbed before hitting you. This is the same reason you don't burn as much in the early morning and late afternoon.
Time-of-day would have far more bearing than latitude, since most human population is within ±45.
I found a nice discussion of the calculation: https://www.epa.gov/sunsafety/calculating-uv-index-0 It hand waves a bit on how latitude is factored in but states clearly that every km of elevation increases exposure by about 6%.
Mexico City: 2,240 m London: 25 m
So 12% more UV for Mexico City based on elevation. The elevation is important but not the primary factor.
Anecdotally, I have been in Mexico City. I did most of my walking in the mornings and still would sunburn on an sixty minute walk. I did not use any protection.
Then I visited Panama.
In the UV tracking app I use, the largest cloud-effects I’ve seen are in the range of 1-3 points decrease. So, UV index of 5-7 instead of 8.
Depending on the baseline UV level during exposure, that difference could be significant (5 index down to 2) or not that significant (14 down to 11), in terms of expected minutes until sunburn.
So you can get skin damage without burn.
Walking around a whole day outside without anything covering my head turned out to be a bad idea.
Equally overcast on a high UV day in Bangkok on the other hand...