The lights should be designed so that if you don't have enough space to stop with a mild deceleration you should just go through. If a mild deceleration get you rear ended then of course that's an unsolvable problem
There was actually a scandal in Chicago were a study found that the city systematically reduced the length of yellows only on lights that had red light cameras in order to harvest tickets.