Even if the engine accelerates, the brakes are capable of stopping the car. The engine and the brakes are two independent systems.