Bus riders subdue attacker, help avert collision; 24 injured