There is an older SC ruling preventing fedgov from retroactively revoking earmarked funds for unrelated reasons. But they can tie future spending to activity. It sort of depends if this $28M was tied to cooperation on immigration enforcement.
This kind of thing could swing both ways - like, a leftist government could revoke money from states that don’t impose a 10-day waiting period on gun purchases or a 10 round magazine limit. So I think if money is promised for activity A, then it should be paid if the terms of activity A is honored and not revoked because of activity B.
A condition for accepting federal money is that they enforce all federal laws. Since they are not inforcing immigration laws, they are breaking the deal, not the Feds. I think the Feds would win this case in the Supreme Court....based on the law.