At some distance before the tunnel or passage under a bridge with limited height (but after the signs that advertise this) there is a solid metal barrier at the height limit and when any too high truck attempts to go forward (which of course happens from time to time) the barrier cuts the top of the truck, which is guaranteed to attract the attention of the drivers (and presumably the anger of their employer).
EDIT: I have posted this before watching the video, which shows exactly how this method, of using a steel "crash beam" works.
In this case, the truck was only slightly above the height limit, but in another place I have seen a similar incident where the truck was higher so all its roof has been cleanly cut and detached from the truck.
This is the right method of handling such height limits, the only one that is guaranteed to be foolproof.
Even if it damages the vehicle, if the vehicle were able to pass with an extra height, it is certain that it would be damaged anyway, but in worse conditions, especially in the case of a tunnel.