The appeals court’s decision delivered an important but interim victory for the Trump administration.