In both cases, the tension in the pendulum string will provide for the acceleration a as well as the counterforce to the weight of the pendulum.
In the vertical component:
In the horizontal component:
Combining both equations,
The difference in both cases lies in the direction of the tilt.
In (a), forward acceleration on a straight horizontal road would cause the pendulum to swing backwards.
In (b), assuming horizontal circular motion, a sideward acceleration is required such that the pendulum will swing to the further side of the turn. However, the degree of banking in this case would determine if the pendulum swings to the left or the right or not at all.