(a) Passengers sitting or standing in a moving bus share the motion of the bus.
This means, the passengers in a running bus are also moving with the same speed in the same direction.
When the running bus stops suddenly, the lower part of the passenger's body comes to rest, while the upper body portion continues to remain in motion.
As a result, the passengers are thrown in the forward direction when a moving bus stops suddenly.
(b) When a passenger is sitting or standing in a stationary bus, both the bus and the passenger are at rest.
When the bus starts moving (accelerates from rest) suddenly, the lower part of the passenger's body starts moving forward with the bus.
The upper part of the body tends to remain in the position of rest due to its inertia of rest.
As a result, therefore, the passenger falls (or leans) backwards.