All parties have also been asked to return to the negotiating table.
Justice Bashar Alkali made the order on Friday while ruling on an application by the Federal Government.
The court held that there is no amount of money that will compensate for the loss of lives in the circumstances.
Counsel to the Federal Government, Mr Tochukwu Maduka, had moved his motion for interlocutory injunction and prayed the court for an order restraining the defendant from continuing with the industrial action pending the hearing and determination of the substantive suit.
He argued that the resident doctors are persons who provide essential services and cannot embark on strike as continuing to do so will wreak hardship on citizens.
Counsel to the resident doctors, Femi Aborishade, vehemently opposed the application for interlocutory injunction and urged the court to discountenance their application.
He argued that the life of a medical doctor is not less useful than the life of an average human being.
He further pointed out that justice must be balanced, not just to the government, but also to the doctors who are the field marshals in the face of the ongoing COVID-19 pandemic.
Both parties had told the vacation judge, Justice Bashar Alkali, at the industrial court, on September 15, that they were set to negotiate and give the court an update by Friday.
But the process of negotiation and possible settlement failed.
Speaking shortly after the ruling, counsel to the doctors, said he would advise them accordingly and show them other options of appeal, but they would not disobey court orders.