The process of extracting the rare earth minerals and processing them to a usable commercial state are very energy heavy processes and polluting in their own right. An EV’s environmental friendliness is also contingent on the energy infrastructure in the area it’s being used. At the current state on carbon emissions alone an EV takes maybe about three years to just become carbon neutral, and then who knows how many years it has left before it becomes a carbon negative piece of machinery.
There are other contingent factors as well such as the carbon and hydrocarbon cost of laying and maintaining automotive road ways. And parallel factors that moving to EV or autonomous cars won’t fix traffic, since the same number of gas cars converted to EV or autonomous vehicles still equals the same number of cars previously, and all the other issues associated with them concerning the inevitable fluid leaks and seepage into ground water reservoirs or the watersheds. An EV or autonomous car still presents a point of conflict with wildlife or pedestrians.
You could on the other hand reduce environmental impact by building some train cars and a nuclear power plant to power an electrified rail route. A train, trolley, or subway can carry more people along the same routes as automotive traffic and a much lower energy cost points of impact with anything outside of it (the train hitting a deer, for instance). Good and rationally laid out public transportation systems can carry more people and goods per pound that car and truck traffic, making lower resource costs to do the same thing whether or not it’s hydrocarbon based or alternative fueled based (just do not put the battery on the vehicle, this always means in a few weeks the weight of the battery will break the under carriage and drop it through the vehicle, as seen in a transition to battery powered busses in Philadelphia like a year or two ago).
This does demand urban and suburban redevelopment though. But if there’s one thing I’ve learned about the history of changing urban development plans for the popular good you can do this with a brawl in council chambers, which killed the era of urban freeways.
There’ll still be need for cars, there’ll always be a number of people who live in non-suburban or hopefully non-subdivision communities in the country side. They’ll inevitably be the permanent market for cars. But in total, rural residents unironically have a much lower environmental impact than their suburban counterparts supposedly “living” 15 minutes from everything else.