Trump has been winning in trade talks, but his tariffs are now facing a key test in federal court