Although the reason for why the trolleys disappeared isn't a straight simple answer, it can be best described as being replaced by what was considered a better, less expensive technology. Buses, first electric and then gas powered, were considered better and more flexible. As the internal combustion engine became more powerful and reliable by the 1940's, the flexiblity without the extensive maintenance that tracks required made the buses far cheaper and quicker to operate and dramatically reduced the infrastructure necessary for operation. No rails, no power stations, no overhead wires, no conflicts with crossing other rail lines, could immediately detour around bad road conditions or be re-assigned to new routes without the need for extensive pre-construction. Less problematic during inclement weather like light flooding or snow covered roads. Could run on paved, dirt or cobblestone roads (don't forget, up into the 1950's, a lot of roads were still dirt and gravel). And the engines were (at least back then) so simple and easy to build, maintain, and rebuild (electronic equipment and pollution control wasn't included yet). You could practically rebuild the entire drive train out in the street at curbside.