Indeed buses or by no means the optimal technology of transporting people. But they often are the cheapest and easiest, and therefor often the smartest choice for urban planners. However once buses start to become congested (Seattle, I’m looking at you), or forseen to become so, they really are a terrible option next to some sort of a train (light, or heavy, underground, elevated, or on ground).
Buses could probably work in urban areas if there were less cars. Today cars come from far and wide "bunch up" in cities. Much of the reasons why trains are better in urban areas today is because of the dedicated space and being electric. But train don't get to really use their speed, easier environment or carrying capacity much in urban areas.
With less cars in cities buses could be competitive with trains since they are street level and can go in different directions, but the would probably still have to be electric and automated for that to be true. (Of course you would still need subways and commuter trains anyway, but you wouldn't be as dependent on them). Trams could probably also be an option, but I am not entirely sure on the future of self-driving trams.