There are ways to avoid having buses stuck in traffic. Dedicated lanes for public transport, getting more people to use public transport rather than cars, and so on. So I'd say it's more often than not a choice in planning if it's convenient compared to using cars or not.
(There's also the problem of less developed systems often being less convenient, and because of it not having the funding needed to expand due to low usage)
Dedicated lanes exist in this city, but not every street has them of course. The line in question also services a street that does not have a dedicated lane. And that's where it sometimes gets stuck in traffic. Funnily, it used to be routed via a different street that actually does have dedicated lanes. But back then the bus got stuck in the narrower street connecting those two.
(There's also the problem of less developed systems often being less convenient, and because of it not having the funding needed to expand due to low usage)