The second hand market for EVs is getting pretty interesting. There are lots of EV owners that are replacing their EVs every few years and because of all the growth over the last 10 years, there are now quite a few fairly nice EVs on the second hand market. Many are typically still under drive train warranty. For example, the model 3 has only been on the market for about eight years and it came with eight years of warranty on the drive train. So, most of the second hand ones would still be under warranty. And most of the EV market only started growing after that. So this is true for many second hand EVs.
And car batteries don't seem to spontaneously stop working right after the warranty expires either. So the risk is fairly low. They'll eventually degrade. But if you can pick up a car for a few thousand and then drive it for another 5-10 years, who cares? The fuel savings alone pay for the car after just a few years. Add the savings on maintenance and you are basically in the plus.