To the extent that they are all old and a predominant majority have been subject to some type of headgasket attention by replacement or additive campaign (particularly the ones you're looking at) - this doesn't much matter and what everyone said is practically relevant. But it's also somewhat misleading depending what and why you're comparing.
All EJ's have headgasket issues and "headgasket mileage" isn't a relevant indicator for purchase between two competing EJ25's. 00-04 EJ25's commonly failed under their existing 36,000 mile warranty and all were offered a free additive campaign and 100,000 mile extended headgasket warranties.
00-04's leak, usually coolant externally, and progressively get worse over long periods of time. They are less likely to leak oil, but can. You can drive them 100,000 miles just topping the coolant off, so they're not all that concerning. Of course shops would just say "headgasket" and people freak out, and to their defense, many shops may not have known that this was a very slowly propagating failure. And we are just post-EJ25D which had eggregious, stranding, catrastrophic headgasket failures so some people/shops would be gun shy.
Anyway - so the 00-04's frequently have issues but they're not that alarming at all. They rarely can overheat as a lone symptom, but it's rare/not common.
05-09 are basically the same except they leak oil and it usually get worse much more quickly. Driving them more than 20k with an existing oil leak may or may not be a big deal. But again - no stranding issues or anything. They are also prone to a low rate of lower end bearing failures because you can drive with low oil without any symptoms and destroy the lower ends. 5 years ago I could pick one up every week with a blown engine. The 00-04's usually leaked coolant and would offer incentive or symptoms to keep it topped it off, most people aren't going to drive overheating, steaming, etc. The 05-09's are more risky if people don't know or try to limp them along and forget or dont' check oil.
So to put this all in perspective when buying, I don't consider mileage relevant at all. It is slightly, but it's no more order of magnitude than anything else is susceptible to higher mileages...fluids, trans, bushings, rust...:
1. All of what I said is true of factory installed original HG's. Replaced HG's have more variable failure modes. Aftermarket gaskets have been known to fail in months, seen it many times (not personally but someone else doing it).
2. In terms of headgaskets the 00-04 are superior. It's the most benign headgasket issue due to it being more obvious, having more symptoms, and Subaru was more proactive towards them early on. And they get worse more slowly over long periods of time - giving you 10's of thousands of miles and years to plan to repair it. So buy one that's currently not leaking or repaired properly with Subaru gaskets and heads resurfaced, and you can almost plan on 50k of never having to worry about it.
3. If they've never had bad oil leaks or had HG's replaced early and you have a great feeling it never ran low on oil - they're also a fine candidate. But verifying that is kind of tough. You just don't want one that ever ran low on oil. Those are asymptomatic and risky.
Or just buy one with a blown engine and see if Subaru still sells the $2,000 OEM engines. $1,000 rust free blown engine, $2,000 new Subaru engine, $1,500 to install it - and you're got a rust free zero miles engine with 36,000 mile warranty for $4,500.