We do own a 4th gen so I can put some input here... get ready for the tirade of pissed off 4th gen owners.
As far as being able to last: It has been pretty reliable, but the sheer amount of plastic will definitely show in the coming years. The earlier 4th gens are already showing noticeable paint fade around where I live, my mom's 04 Sport Edition included. The flares and headlight lenses are the worst parts so far. The 4th gen interior is nice, but the plastic coating finish that peels on many of them doesn't give the impression that it will last.
To have a 4th gen in perfect shape with all of the fixings like projector headlamps, LED tail lights, sport package, JBL soundsystem, etc. would probably be the best bet... but I feel the vehicle may suffer from obsolescence... mainly due to the electronics. Electronics are constantly evolving, they change much faster than body styles do. Computers control much more in the 4th gen than in earlier gens (IE: drive by wire, XREAS, push button 4WD, whatnot), and replacement of those items can become expensive in the future when those electronic technologies have long been replaced by an advanced, more refined technology. While some may argue that electronics have made purely mechanical items obsolete, mechanical parts can prevail in ease of production and simplicity of function. Electronics may require programming, calibration, testing, etc, that make any job more difficult or time consuming.
Older gens had a lot of mechanical parts, guaranteeing easier replacement in comparison to an electronic counterpart. Companies who make replacement parts would have less trouble producing these parts. Take this point from my work, the W140 Mercedes-Benz S-Class. This car came out in 1992 until 1998 in the US. It was sold for $80k+. Today, even pristine examples of the V12 models go for little to nothing due to one common module failure. People are selling mint condition S600 V12's with little miles for practically pennies, even with showroom perfect leather interiors. No one wants to buy them around here anymore. Fixing the issue is costly and not guaranteed to be reliable. Junkyards have been exploding with W140 S-classes, a car that was not even in the local yards 3 years ago.
Let's say something similar happens to the 4th gen. The popularity may have an effect, but let's say this happens 15 years after the final production run. Who will make new electronic replacement parts? How hard would it be to buy a replacement electronic part for a car that old? The amount of electronic parts to fail is pretty high. Imagine if one part failed widely, and finding one was scarce. That'd have a big effect.
It may not happen that way, but I'd be worried of something along those lines. At that point, it would be much easier trying to get an older truck working than dealing with all of the electronics on the newer model.
This doesn't just pertain to the 4th gen, I'd say almost anything since the early 2000's era that predominantly uses electronics for proper operation. With these electronics, it's easy enough for one thing to fail and disable the entire vehicle, or a critical function of the vehicle (IE: The liftgate electronic latch quits out so you can't get your groceries into/out of the trunk, the steering inclination sensor fails and throws off the traction control and ABS, etc etc...) So many things potentially doomed to fail, that support so much.
And of course, the owner will go insane from their floppy sunvisors and scratched gauge cluster face lol... and still no one will notice the blind spot mirrors.