If you put 170k miles on a gas car, wouldn't you have paid for $10-12k in maintenance over that time? At that point you've done 20 oil changes, replaced the spark plugs & air filter 5 times, replaced the timing belt and transmission fluid twice, replaced the brake pads 3-4 times, replaced the brake rotors, water pump, alternator, and maybe even a head gasket, starter motor, and fuel pump.
Assuming you averaged 30mpg, you also put $20k in gas through it. At the current US average retail electricity price of 17 cents per kWh and EV efficiency of 250Wh/mile, recharging would be $7,200 for that same distance. The fuel savings alone are more than the cost of replacing the battery.