Musk’s legal team informed a Manhattan federal judge that both parties had agreed to withdraw their respective motions, thus ending the two-year-old litigation.