San Francisco has had a fairly extensive trolleybus network since the 1930s. Although only 15 bus lines are trolleybuses, those are the most crowded bus lines, so a significant fraction of bus traffic there is electrified.
It appears that diesel buses cost $450,000, and battery-electric buses cost $825,000, and trolleybuses cost $1m each. Trolleybuses last at least twice as long as diesel buses. The overhead wires cost $2 million per mile and last almost indefinitely, it appears, because I have never seen maintenance being performed on any of them, in contrast to roads and stoplights which are being repaired constantly, and buses which are being replaced often enough.
San Francisco has 300 trolleybuses for 15 lines, and each line is about 6 miles long. Thus the overhead wires cost $180m, the buses cost $300m, and the electricity costs $48m over 24 years. It appears that equivalent diesel buses would cost $270m and use $330m in fuel over 24 years, servicing the same routes (just using the numbers I read from an article and doing the calculation manually). It would appear that trolleybuses cost ~$528m for those routes and diesel buses would cost ~$600m. However, that's not taking into account financing costs etc, which would probably make the trolleybuses more expensive than diesel ones since the upfront cost is higher. Also, this is for routes in San Francisco which are only 6 miles long; the economics may change for suburban routes.
That said, it doesn't seem like the costs are very different whether we choose trolleybuses, diesel buses, or battery-electric buses. It may be slightly more expensive to go electric, but not much.