Yes many contracts contain unenforceable or unactionable clauses that are superseded by common law. This is an example of that.
For example a tennant can sign a lease that says they have no notice period before eviction. If they’re in a state with a 30 day minimum notice period then the notice period is 30 days. It doesn’t matter what the contract says.
Google would comply with the US court order and ignore the contract it signed with Israel.