IF you are running frequent service, then a trolley bus with all the wire costs is cheaper than batteries or engines. However most bus systems have a lot of less frequent sections and so it isn't worth it.
The real disadvantage of a trolleybus is your are stuck going exactly where the wires are. If something is blocking your lane you can't go around. If you want to close the road for maintenance you can't run the trolley bus. This loss of flexibility makes the regular bus make more sense in a lot of cases.
If you do have a situation where a trollybus will work, you probably should just put in a train that doesn't run in traffic. A tram running on tracks that are not in a road at all isn't much more expensive, and can handle more people than a bus in the busy part of the day. I'm a big fan of the automated light metro system idea: it runs faster than a tram (because it doesn't have to worry about anything in the tracks), it is cheaper in the long run (operating costs the big cost in any transit system), is can run 24x7 (if designed for it - many are not), and you won't have problems finding crew (many transit systems have the money to expand service, but cannot hire qualified drivers). In the end though there are pros and cons to everything so you need to figure out what is best for you.
The real disadvantage of a trolleybus is your are stuck going exactly where the wires are. If something is blocking your lane you can't go around. If you want to close the road for maintenance you can't run the trolley bus. This loss of flexibility makes the regular bus make more sense in a lot of cases.
If you do have a situation where a trollybus will work, you probably should just put in a train that doesn't run in traffic. A tram running on tracks that are not in a road at all isn't much more expensive, and can handle more people than a bus in the busy part of the day. I'm a big fan of the automated light metro system idea: it runs faster than a tram (because it doesn't have to worry about anything in the tracks), it is cheaper in the long run (operating costs the big cost in any transit system), is can run 24x7 (if designed for it - many are not), and you won't have problems finding crew (many transit systems have the money to expand service, but cannot hire qualified drivers). In the end though there are pros and cons to everything so you need to figure out what is best for you.