The comma is used in writing to convey the idea that the which clause does not go with the immediately preceding element but with something more distant. However, this does not eliminate the abmiguity from the spoken language. There isn't any way to pronounce the comma to eliminate the ambiguity.
Semantics of the sentence eliminates the ambiguity. It is documents which contain embarrassing material. Inquiries do not contain; they are carried out and produce findings.
Language is inherently ambiguous. For instance:
John ate the sandwich in the fridge
Did he eat it in the fridge, or did he find it in the fridge? Both parses of the sentence are valid syntax, but only one makes sense.
One way you avoid ambiguity is to make the meaning so clear that there is a single correct interpretation, and the others are ridiculous.
Another way you can avoid ambiguity is to basically embrace it: there are two interpretations, but it basically doesn't matter which one you choose.
So for instance, your original sentence is works because inquiries don't contain. Suppose we have another noun there instead of inquiry:
The department shredded all the files from the box which contained embarrassing material.
Is it the files which contained embarassing material, and the box had other files which did not? Or did the box contain nothing but embarassing material?
Unless this subtle distinction is somehow very important in the overall message, who cares!
If it becomes important, the people who are communicating can seek clarification. Were there other files in the box, and what happened to those?