Hydrogen vs. Battery Electric Cars

Batteries require rare metals to work.  That limits us to how much rare metals are on the Earth?  Same problem with oil.  Can we scale by recycling rare metals or can we recycle hydrogen?  I think we've proven hydrogen can be recycled by using sunlight while I have not seen rare earths being recycled that way.  The only energy we get is from the Sun.  Oil is that energy from thousands of years ago.