It is true that early versions of the MD-11 did not meet the MD promises of range and payload, however with the addition of winglets (this occured before delivery) performance was enhanced. A later, but not much later fix was the retrofitting of an additional fuel tank in the belly which allowed the MD-11s to have a range comparable to that of the longest long range A340s/777s and 747-400s. This improvement was not only offered as a retrofit but on new build MD-11s as well. Delta lists their MD-11s range at 7,360 nm, thats 360nm more than their 777-200s at 7,000nm. So the MD-11ER outranges the 777-200ER.
The main factor for replacing MD-11s is that there arent any more available. Existing fleets cannot be augmented by new aircraft of the same type. The MD-11 will certainly remain in service for many years to come as it is a very efficient aircraft for hauling cargo. There are 200 MD-11s out there which is not a tiny number of aircraft so dont be surprised if FedEx snaps up many more of them as they come up for sale or return to leasors. I expect Lufthansa will also buy additional second hand MD-11s to augment their new-build fleet of 14 aircraft. There are still 2 new build MD-11Fs to be delivered to Lufthansa in the next six months, after those deliveries, thats the end of the MD-11 production line and likely the end of the tri-jet era.