A federal judge has permanently blocked the Trump administration from withholding nearly $34 million in funding earmarked to protect New York’s transportation system from terrorist attacks.