The construction of the batteries is extremely resource intensive, and they degrade with age. Also logistically in colder temperatures and hilly areas the batteries drain quicker. Trolleybuses don't have these issues, they're also much lighter so they don't cause as much damage to the roads.