The UN's top court has ordered the United States to lift sanctions on "humanitarian" goods to Iran, which President Donald Trump reimposed after pulling out the multi-party 2015 nuclear deal in May.