I see it the other way. Trolleybuses (with either battery or diesel backup) are the best of both worlds. Much cheaper to built (compared to a tram) and doesn't pollute in the city (compared to a full diesel bus)
Trams are surely better, but the simple infrastructure and relative simplicity of the drive train make trolley often cheaper than a diesel bus. Trolley buses with a small battery can also deviate from standard lines or bridge small areas between trolley lines.