Because the brake light indicates braking, and is connected to the brake? This is already a perfect solution.
An accelerometer is a terrible idea to replace this. You would have to cover the car with sensors and tune them so that accelerating uphill doesn't trigger the brake light, and that braking downhill will successfully trigger the brake light.