Billionaire Trump adviser Elon Musk violated the law with his demand that US federal employees explain their accomplishments or risk being fired, lawyers for the workers said in a lawsuit.