A US federal judge has thwarted Trump’s biggest attempt to stifle the H-1B visa