Not sure I agree. The batteries are part of the car and need to be considered. There is also the question of disposal at the end of their life that has still to be tackled.
The fact an EV has to have a battery isn't in question. but the way the ecology of the system adds up is rather different to that of an ICE vehicle.
With an EV the build of a the battery has to take place before the vehicle can run. That means the ecology and cost of the construction is loaded onto the vehicle. Its significantly lower ecological load of the generating the power to charge the battery and the efficiency of the electric drive throughout the life of the vehicle that brings the benefits. It has to bee seen as a long term pay back.
ICE vehicles are cheaper to produce (due to the processes that legacy manufacturers have to work with) and the fuel system is simple and has a lower build cost and ecolgical load than building a battery. But unlike batteries, everytime you full up with combustion fuel, you have the ecological costs of extracting, refining and transporting the fuel to the vehicle - each and every time.
Add to that the inefficiency of ICE and the pollution they spread, the benefits of EV from an ecological perspective ae better than ICE and improve over distances.
Every vehicle adds an additional ecological load with servicing and any repairs or replacements, but the evidence is that in terms of drive components EV's long terms costs are considerably lower than ICE.
I do not discount the problems of battery disposal, but it is far from as bad some contributors would have us believe. First of all batteries in EV's usually do not fail catastrophically. they degrade, but even here the rates of degradation are far lower than had been expected. Most manufacturers now offer battery warranties of 100K plus, and of course most last much longer. That is on a par with the warranties for ICE vehicles, but within that period ICE engines will have probably had several services and some replacement parts, either by normal wear and some because of failures, not to mention oil + filter changes . (I exclude non drive train related issues from this comparison)
When a battery is no longer suited to be deployed in an EV, it does not automatically mean it has to be destroyed, it has many other potential uses. ICe engines if the are no longer usable, a few parts may be reusable but basically they are scrapped.
Even if a battery or an engine needs to be replaced, they both incur material and ecological costs, so they are not to far apart there either.
I have never claimed EV's are zero emissions, (though undoubtedly they are zero tail pipe emission) and they are not the complete answer to saving the planet , but every reputable study has concluded EV's have a lower whole life impact than ICE on the environment.