Fuel cells and batteries are fundamentally pretty similar. Fuel cells require that you put in a lot of not necessarily clean energy in a central place to generate hydrogen, then distribute that hydrogen to vehicles, which then use it to drive in a way that doesn't produce further pollutants. The same can be said of electricity. You generate it in a not necessarily clean way, distribute it to vehicles, they use it without polluting further.
Cleanliness isn't really any reason one way or the other but there are other differences. Energy density of hydrogen fuel cells is higher than Lithium ion batteries so vehicles can travel further. On the other hand, physically moving hydrogen is relatively expensive and infrastructure to do so doesn't currently exist while distribution of electricity is a thoroughly solved problem and is relatively efficient.