Get your taxes done using TurboTax

Federal law controls the tax return.  A state judge can't authorize parent #2 to claim a child without form 8332 if parent #2 is not the custodial parent, the IRS will reject the claim.  And a state court judge can't issue an order allowing the non-custodial parent to file as head of household or claim EIC, because that would violate federal law.  
But the judge can very definitely order parent #1 to sign the form 8332 for parent #2, or hold parent #1 in contempt, or fine parent #1, or change the child custody or child support orders in ways that are adverse to parent #1.  Judges don't like to have their orders ignored.  Whether you can or should ignore your court order is a matter for you and your attorney.