Most batteries do not use rare earth metals. Even if they did and it was an issue, we would find alternatives if that was necessary, just like rare earth free motors were developed to avoid all the downsides of that come with those.

Have a look at CATL’s sodium-ion batteries, they do not use anything expensive, rare, or particularly damaging to extract from the environment.