A federal judge in Manhattan on Wednesday denied a request for nearly $1.4 million in legal fees sought by advocacy groups that had successfully challenged immigration rules erected during President Donald Trump’s first term that made it harder for some immigrants to obtain permanent residency.