In a divided ruling, the court of international trade said Trump had incorrectly used a decades-old trade law to impose the duties in February.