By Jessica Toonkel

CANTON, Mass. (Reuters) - The battle over control of Sumner Redstone’s $40 billion media empire moved to a Massachusetts courtroom on Tuesday, where a state judge said he needed time to decide whether to move up the date of a trial questioning the 93-year-old’s mental competence.

Probate and Family Court Judge George Phelan did not set a date for a trial over whether Redstone knew what he was doing when he removed Viacom Inc <VIAB.O> CEO Philippe Dauman and Viacom board member George Abrams from the seven-person trust that will control Redstone's majority ownership of media companies Viacom and CBS Corp <CBS.N> when he dies or is deemed incapacitated.

"I have a lot to digest," said Phelan, adding that he expected to hold a hearing on Redstone's lawyers' imminent motion to dismiss the case by the end of June.

Phelan suggested the world of multi-billion dollar trusts was a far cry from his own modest upbringing in a housing project, where he said he was “happy to have a quarter in my pocket." He added that "it may take a few days to get there.”

It is not the first time Redstone's mental competence has been challenged in court. A lawsuit brought by his former girlfriend, Manuela Herzer, claiming Redstone was “a living ghost,” was thrown out by a Los Angeles judge last month.

However, Dauman's more recent suit goes further, claiming that Redstone suffers from dementia, impaired cognition, a slowness of mental processing, a loss of memory, apathy and depression.

Redstone's primary physician, Dr. Richard Gold, said in a court document that he sees his patient at least twice a week and had not observed any recent decline in his condition.

"Mr. Redstone exercises daily and has gone on recent excursions to visit with his grandson and also with friends in Malibu," said Gold.

Redstone holds 80 percent of the voting shares in Viacom and CBS through his National Amusements Inc holding company. The outcome of the court case, and who ends up with control over the trust, will have wide-ranging implications for Viacom and CBS shareholders and could result in changes at the top of both companies, possibly through mergers and acquisitions. After a 2-1/2-hour hearing in a windowless courtroom on Tuesday in Massachusetts, the state where Redstone's trust was originated, Phelan said he may or may not decide on Dauman and Abrams' motion for an expedited trial before he receives a formal motion for dismissal from Redstone's lawyers, which is expected in the next few days.

During the hearing, attended by more than 20 lawyers, Dauman and Abrams’ attorneys argued the trial should be expedited because of Redstone’s age and poor health.

“Nobody could reasonably deny that there is a great risk that Sumner Redstone will not be available to give evidence in this trial,” said attorney Leslie Fagen.

The attorneys also argued Redstone was the subject of undue influence by his daughter Shari Redstone. Shari Redstone’s attorney dismissed that idea, saying the two have had “healthy disagreements,” about the business, but the “convention of family and trust has endured.”

(Reporting by Jessica Toonkel; Writing by Bill Rigby; Editing by David Gregorio and Nick Zieminski)