A New York judge on Tuesday ordered President Donald Trump and a woman claiming he made unwanted sexual advances to be deposed by the end of January in a defamation lawsuit that the president’s lawyers say shouldn’t be heard while he is in office.

Justice Jennifer Schecter, who weeks earlier ruled that the case shouldn’t have to be delayed to accommodate a sitting president, set a schedule for party depositions in a case brought by Summer Zervos, a former contestant on “The Apprentice.” The decision means that Mr. Trump could be forced to answer questions under oath.

Ms. Zervos has said Mr. Trump groped and kissed her without consent about a decade ago. After Mr. Trump suggested on Twitter, at campaign rallies and during presidential debates, that her story was a “hoax” ginned up for attention, Ms. Zervos sued, claiming he had “debased and denigrated” her “with false statements.”

The president has said her lawsuit has no merit and has vehemently denied the sexual-misconduct accusations, which Ms. Zervos made during a news conference in the wake of the 2016 release of a 2005 “Access Hollywood” tape of Mr. Trump talking lewdly about women.

In addition to setting deposition deadlines, Judge Schecter on Tuesday said all fact discovery in the case should be completed by April, a timeline that points to a possible trial as early as the summer or fall of 2019.