Chainguard vs front mudguard to protect the chain from spray
Chainguard is not there to protect chain from dirt spray from tires, unless it is a completely enclosed chainguard (which is not feasible on derailleur bicycles). A chainguard is there to protect your pants from chain oil.
Should you install a chainguard, then? Yes! It protects your pants from chain oil.
But to protect your chain from dirt spray, you'll need fenders, too.