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.
It’s not a perfect solution for EVs and Hybrids that can slow down quickly without pressing the brake. Technology connections has a full video on the matter, but basically things need to be updated for current tech if we want to avoid accidents due to information not being relayed to other drivers.