i think the i-6 is a 42re and the 5.9 should be like a 44re or 46?
but if someone else wants to tune in and correct me, but i dont think the i6 tranny would be up to it.
If you're gonna swap, swap the I-6 in and put an AW4 behind it. Any of the 4xRE/RH trannies aren't worth swapping. and like paradise said, your biggest issue on any of it is going to be Computer related.
btw, what are your symptoms for your tranny that makes you think it's going out?
4.0 uses the AMC bellhousing pattern while the 5.2 and 5.9's use the newer Chrysler/Dodge pattern, they will not interchange. The wiring will not interchange either.
To get it all to work, you will need to swap the engine, tranny and ALL wiring from the dash forward. You may run into issues with the factory alarm system as well...
5.9's used the 46RE. There are no easy fixes with these that I've ever heard of. at least with the common problems. It's rebuilt or replace with betters parts/tranny.