This is a standard component of LCA databases and puts the ESOI in the 50-100 range for the first generation of batteries. Subsequent generations are higher.
Electrolysers also require mining, as do fuel cells, as does any source of heat for reverse gas shift or similar.
Your fud about rare earths is also a lie for any chemistry proposed for grid storage. None of them involve rare earths in any measurable quantity (nanoscale films on semiconductors for controllers and such are insignificant)
Hydrogen (or rather hydrogen derived molecules) are a viable method of seasonal storage, but that doesn't mean most of the hype doesn't exist to greenwash gas or that your talking points aren't propaganda.
Hydrogen cars are worse than BEVs and much worse than transit or active transport.