A US federal judge has barred lawyers and self-represented litigants from using AI during arguments or trials after an attorney repeatedly relied on it to answer questions.