The union of prison employees condemned the contract’s termination, which is part of the Trump administration’s overhaul of the federal work force.