As a Subaru owner I may be a bit biased, although I've also owned a Hyundai. The Subaru will probably be more reliable in the long run, not saying they're perfect though and all mfrs have their share of issues. Hyundai touts their 10/100 powertrain warranty but it only applies to the first owner and wouldn't be a factor on a used one (especially an 05 that's out of warranty anyway).
I'd suggest going to the respective forums for the vehicles you are considering and read what owners are posting about them.
And definitely have a good independent shop do a thorough inspection of any vehicle you're serious about, it's well worth the cost. It's also a good way to eliminate a particular vehicle if the dealer or owner refuses to allow the inspection, that's a huge red flag that says "run away".