A federal judge in Manhattan on Friday extended a ban on Elon Musk’s Department of Government Efficiency accessing sensitive Treasury Department information, but rejected broader restrictions sought by 19 Democratic state attorneys general who sued over the issue.