TOKYO - A Japanese court ruled Thursday that it was legal for the trade ministry to impose restrictions on a transgender official's use of women's restrooms, in a case in which she was seeking to freely use the washroom of her choice.