Illegal Migration Act: Parts should not apply in NI, judge rules