But since batteries can be used a few thousand times and then can be recycled efficiently, the volume required is a tiny fraction of the petroleum requirements.
Other materials are used in even smaller quantities. Cobalt is a disaster, but grid batteries don't use cobalt, they generally use nickel & iron.
It is a large environmental impact. But compared to the alternative, it's very green.