Leak down test, oil pressure, opening the filler cap for blow by, sound... Plenty of accessible options there that will diagnose a bad bottom-end or piston rings. Further, your average Joe can replace crank bearings in an afternoon and many could re-ring an engine with some help from youtube. Your average Honda will need this once every 200-400k miles (14-25 average 14k driving years) with proper oil changes.
There are a lot more components (cells) in a battery pack than rotating components in an average engine. I'm unsure if they're generally individually addressable, but I know they're not designed to be serviced at the cell level. That has you replacing the battery pack any time there is a problem, a many thousands of dollars adventure just in parts. There's also no major differentiator from a software perspective between "the battery is old and has reduced capacity" and "the battery is swelling and has reduced capacity". The latter could lead without warning to a catastrophic failure that would make a ringland failure laughable.
I do appreciate your view is held by many consumers who purchase a new or certified pre-owned car every N years. For those in lower income brackets (including most countries in the world) or who like to buy things that last, electric cars don't seem to carry a huge value proposition over a traditional ICE car.