Trump NEVER banned any transgenders from serving in the military.  He stopped/cancelled an Executive Order issued by Obama.  Prior to Obama and his EO  transgenders were barred from service in the same manner as a diabetic or a person with flat feet.  The judge is from NYC and is a Clinton appointee.  Also remember the Obama policy had not yet come into practice even at the time of the order cancelling the Obama EO.