Lots depends on how it's been treated during it's 40K kms. Oil changes? Serviced? What sort of use? Well cared for KLR's can easily top 80K kms.
There are always tell tales (on both the DR and KLR). Obvious ones are oil use, smoking and bad sounds. Bad sounds are the scariest and hardest to figure out. Also, oil leaks can be a sign but mostly are nothing to worry about if minor. Cracked and broken frames/sub frames and duff elec. systems also need to be sorted if acting up. (elecs pretty good on BOTH bikes) Most travelers neglect batteries. New ride? New battery.
If you already own the KLR and know it well ... then that may be the bike for you. I've owned two KLR's but currently own a '06 DR650 (since 2006/55K miles)
Being short, I prefer the DR as it feels lighter and easier to ride when loaded up. Definitely better (for me) off road. Its actually stronger than the KLR in some ways too ... but has a few flaws and niggles ... but is a lot easier to work on than is the KLR.
But BOTH DR or KLR can be set up to do well on a S. America ride, no problem. IMO, you can't pick two better bikes ... but I'm biased.
The KLR has a few more things to sort out and to keep an eye on. Since it's water cooled you've got to look after radiator,hoses and water pump.
(mostly reliable long term) DR only has oil cooler, no Radiator.
The DR is simpler and crashes better (IMO) than the KLR , with less damage
when it hits the ground. But the KLR is possibly one of the most traveled bikes in S. America ... going back to the 90's. (I was there in '98 on my KLR)
There is a good reason for that.
If you already own the KLR ... it might be cheaper to keep it if it's in good shape. Check compression, make sure valves are holding spec. If continually closing up on you ... that indicates it needs a valve job and top end rebuild. (figure $1000 usd for full job)
Other obvious things, DooHickey, cracked rear sub frame, cracked main frames. (both RARE)
Both bikes enjoy massive aftermarket support with plenty of used OEM parts out there if needed. I would meditate over both bikes and try to "feel" which one might be THE ONE. I am, of course biased towards the DR. But the '01 may have a leaky base gasket. (easily fixed with a bead in silicone round the seam).
Light, strong and inexpensive.