The Justice Department, the Department of Housing and Urban Development, a federal judge and a federal monitor have all been scolding Westchester, and especially its county executive, over the implementation of a court order that settled a 2009 housing segregation lawsuit. While the county is on schedule for fulfilling one part of the order — building hundreds of affordable homes — officials say it’s lagging on measures that would fight future discrimination, including an analysis of how local zoning might be prejudicial. Late Friday, the U.S. attorney’s office filed a motion asking a federal judge to compel Westchester to cooperate more fully. HUD is withholding $12 million in grants for local programs — including sidewalk repairs, a van for seniors and aid for homeless families, just to name a few — and threatening fines and contempt citations. The man taking the brunt of the criticism, County Executive Rob Astorino, isn’t giving an inch and predicts the battle will have drastic repercussions. “If a federal department, in this case HUD, can dictate to local officials what they will and won’t do, we’re careening toward a different country,” Astorino said in a recent interview.