Quoted By:
Trolleybuses were invented as an alternative to streetcars in a time where there were no practical motor buses, so it's inception was indeed that of a "trackless trolley". However it was inferior to the streetcar in most ways, even more so in the late 19th-early 20th century. So it didn't really go anywhere until the 1930s.
In the 1930s as traffic grew and buses became more practical while many streetcar systems still used 20 or 30 year old equipment, it was proposed as a replacement for trams. This led down two ways, a good one and a bad one:
The bad one was where trolleybuses were used to eliminate useful street railways, and usually served as an intermediate step towards regular buses. This was generally so in america.
The good one is where the trolleybuses were used as a medium-to-low-capacity electric transport, basically an intermediate step between streetcar and regular bus. These systems were mostly subjected to unavailability of fuel, or availability of cheap electricity (Austria and Switzerland for example).
Trolleybuses still make sense as a way to electrify bus lines with a reasonable demand, yet not enough as to require a tram line. It's a relatively cheap, durable and simple way for electrifying bus service. But they're certainly no substitute for trams, since they still play in the same leage as regular buses.