With battery prices trending to 50$ per kwh, a decent size bus battery of 250kwh would cost about 12.5K. That's manufacturing cost, not purchase cost. But it drives the point home: long term batteries are going to dip even further. Far below 50$/kwh. It will drive down the cost of battery electric drive trains for everything with wheels to far below that of the traditional setup with ICE engines. And they don't need expensive fuel to run. Or a lot of engine maintenance and servicing.
Currently tens of thousands of electrical buses are produced per year. Most of them in China. Which is of course where they have lots of battery factories. It's a rapidly growing industry.
Granted, these trolleybuses also have batteries and only spend about 1/2 of their journey under wires.
The poles also make for convenient overhead charging docks, which you can add on a somewhat piecemeal manner. With some automated guidance, that means you can charge the buses at long-wait stops or when they wait to run the route back even though they're not a a depot, without the need for an "accessible" charging infrastructure (or the driver needing to move out, go open an electric cabinet, plug in a charge cable, then remember to unplug before going back out).
The pantographs of trolleybuses are often pretty long, so they can switch to the other lane to avoid obstacles.