Not quite but it certainly helps against them!
To give an example (as seen in Allan Mills' answer), see the description of the major image spell:
Physical interaction with the image reveals it to be an illusion, because things can pass through it. A creature that uses its action to examine the image can determine that it is an illusion with a successful Intelligence (Investigation) check against your spell save DC. If a creature discerns the illusion for what it is, the creature can see through the image, and its other sensory qualities become faint to the creature.
You still need to use your action to examine it, but passive Investigation can come into play by setting the floor for the roll. (Note, not all DMs will go with this, but I haven't seen a DM not go with it.) For example, as you said in your question:
Let's assume a character has 20 passive Investigation. A level 13 caster with 20 INT, has a DC of (8+5+5) = 18.
If the DC is 18 and your character has a 20 passive Investigation (for the sake of this example, I'll assume that your character is also a level 13 with a Intelligence score of 20 and is proficient in Investigation), then if they roll for the Investigation check and the roll before modifiers is a 7 or lower (+5 for Int mod and another +5 for proficiency for a +10 total), that roll totals 17, which is lower than the character's passive Investigation. In cases like this, you would use passive Investigation as the floor for the check, bringing the total roll up to 20. So your passive Investigation makes you, in this case, auto-pass any check you make with a DC of 20 or lower.