They weren't fired for failure to carry out their duties, they were fired because they were more expensive than their H1B replacements, which clearly violates the purpose of the H1B program.
So, was it legal for Disney to fire them? Probably. Was it legal for Disney (or rather, its contractor) to replace them with H1Bs? Probably not.