By Tom Hals

WILMINGTON, Del. (Reuters) - Viacom Inc's <VIAB.O> directors can stay in place, at least for now, as a Delaware judge said at a hearing on Wednesday that a legal fight over who should sit on the media company's board may turn on the mental competence of 93-year-old controlling shareholder Sumner Redstone.

Last week, Redstone and his National Amusements Inc holding company removed five of Viacom's directors, including Chief Executive Philippe Dauman and lead independent director Frederic Salerno, from the company's board.

That marked a big step toward a potential management shake-up at Viacom, which along with CBS Corp makes up Redstone's $40 billion media empire.

Redstone and National Amusements sought the approval of the Court of Chancery in Delaware - the state where Viacom is incorporated - to kick off the board members. Salerno filed a lawsuit in the same court last week seeking to block the move.

Judge Andre Bouchard on Wednesday brought together the two actions, and said he planned to hold a hearing in July to listen to arguments about whether National Amusements' move was valid.

He quizzed attorneys on both sides on how the issue of Redstone's mental competence factored into their arguments, indicating he was reticent to weigh in on the issue himself.

"There are underlying issues of competency that might be relevant," Bouchard said, noting that a Massachusetts court is looking into the issue in separate litigation.

"I have some skepticism this can be resolved on this motion ... the underlying issue of competency might be relevant, but that is playing out elsewhere and I won’t weigh in." he added.

The two sides told the judge they anticipated reaching an agreement later this week that would leave Viacom’s board in place but would also prohibit any of the directors from taking any actions outside ordinary day-to-day operations, including its planned minority stake sale of Paramount Pictures.