Modern lithium batteries can
Modern lithium batteries can endure several thousand cycles. In a truck with 500 miles of range, a million miles is 2000 cycles. Even then, it just runs with reduced range. The bigger problem with batteries is the corrosion that destroys them over time. This will be a problem for 20+ year old trucks. Diesel trucks might have a cost advantage for long haul trucks that are driven less than 25,000 miles a year, but I don't think there are many trucks like that.