The city busses in San Francisco operate like this.
https://www.sfgate.com/bayarea/article/Muni-trolley-wire-visual-pollution-electrifies-5056671.php
Seattle has some routes with electric buses as well. I seem to never see more than a couple of people on them at a time, albeit, I may not be seeing them at peak times when I visit my brother.
In pre-COVID times, they were packed on weekdays but have "good enough" frequency to not leave riders stranded.
This blog post has some of the March 2019 and March 2020 average weekday ridership stats, which I'll copy below for the respective trolleybus routes:
Route 7 - 10,981 (2019) - 11,193 (2020)
Route 36 - 9,407 (2019) - 9,037 (2020)
Route 44 - 9,783 (2019) - 8,390 (2020)
Route 70 - 9,050 (2019) - 7,100 (2020)
The other trolleybus routes (1, 2, 3, 4, 7, 10, 12, 13, 14, 36, 43, 44, 47 [suspended], 49, and 70) have their ridership updated in
system evaluations.
The trolleybuses do require extra awareness while driving to keep the contacts on the wire, as they can and will dewire on tight turns. The driver then has to get out and manually rehook them (though the newer gen of buses can use battery power to scoot out of an intersection).