Sure, you can't really rely on that, but I consider it very, very unlikely that the city would take the initiative to go out and measure the height of the hedges.
It is much more likely that an overly picky neighbor, who probably exists almost everywhere, fulfills his German civic duties and reports it, although I also consider that unlikely.
In our area, for example, someone even built his garage right on the property line (which would still be okay), but he wants to build a terrace on it, so that with a railing he would exceed the 3m height limit.
Although he probably hasn't yet obtained the neighbor’s signature allowing him to build on the boundary, the thing is already standing and nobody seems to mind...
Another idea might be not to make the entire property invisible, but only the terrace, so basically tall plants around the terrace or a tree on the property, etc...