US District Judge Kathryn Kimball Mizelle said the national public health agency had exceeded its legal powers in issuing the mandate.
The US transit authority said it would now no longer enforce mask wearing.
The US Centers for Disease Control and Prevention (CDC) just last week extended the mandate until 3 May.
Judge Mizelle is based in Florida, but federal judges can issue rulings that block nationwide government policies.
Her order on Monday effectively removes the masking requirement in all airpts, trains, taxis and transit hubs.