Fusion and Optima are significantly overpriced, especially considering the fact that they're in Rustland. In places where that's not an issue, they're still overpriced.
Cases in point:
https://dallas.craigslist.org/mdf/ctd/d/2007-ford-fusion/6373059985.html
https://dallas.craigslist.org/dal/cto/d/2007-ford-fusion/6331691808.html
https://dallas.craigslist.org/dal/cto/d/2008-kia-optimadrive/6368938117.html
That last one? It's a DEALER. And it's $1200 cheaper.
The XG is eXtra Garbage. They didn't hold up well. On top of that, the Sigma V6 3.5L is NOT related to the current and recent past excellent V6s Hyundai's been using. The 3.5L version of the Sigma was only in the US from 01-06 and then Hyundai killed it off as soon as they finished development of the excellent Lambda V6. The Sigma is an orphan engine that Hyundai would rather forget it ever made. Run away from that thing.
Of that list, still Pathfinder then RAV4. The Pathfinder is just a better design and has better running gear than the RAV4; it's also sturdier and is a proper RWD in 2WD mode - plus it has a multispeed locking transfer case and is significantly more powerful. The RAV4 is a a tall Corolla wagon with 'sometimes' AWD.
- - - Updated - - -
Yup, going straight for the beige again...
Amusingly... per the Wikipedia page on the XA20:
- - - Updated - - -
More significantly, you are apparently unaware of the two big nasty problems with the 2.4L 2AZ-FE. First problem - these engines can suddenly decide to burn oil (defective piston ring design) at a rate fast enough to exhaust the crankcase between oil changes. There is a TSB on it (#0094-11) but Toyota refuses to recall the motor or fix the problem at their expense. Owners are left on the hook for this. On those under warranty, Toyota insisted that 1 quart of oil per 1200 miles was 'normal consumption' for the engine.
The other problem is that the engine has a head gasket problem where three head bolts can (some say 'will') pull out of the block - they're in the middle of the head, closest to the firewall. Toyota's done an extended warranty on the issue (program identification: ZE7) but they refuse to take any pre-emptive action and you'll have to wait for your engine to fail or for signs of a blown headgasket to appear before you can bring it in for warranty coverage. This 2004 is too old to be covered under ZE7 as it was issued in 2015 but it is a known issue on that engine even so. Toyota only went back 10 years on ZE7.
While these issues can be dealt with (and replacement engines for the RAV4 are cheap), I certainly wouldn't place that as my first choice. The VQ in the Pathfinder has no such history of spitting up head bolts; when they found some VQs burning that much oil Nissan replaced them.