Transportation Minister Geoff MacLellan said the proposed change to the Railways Act would require Genesee and Wyoming to wait six months after getting approval from the Utility and Review Board before it can apply to the government to abandon the line.
MacLellan said the change would also prevent the company from ripping up portions of the rail line if it's given permission by the Utility and Review Board to discontinue its freight service.
He said that would ensure groups exploring other options in Cape Breton have time to potentially find another operator.
"We are not imposing anything unreasonable here," MacLellan said. "Nova Scotian taxpayers have invested $23 million in this line since 2002. It's a significant number."
Genesee and Wyoming is to appear before the Utility and Review Board in hearings scheduled to begin Dec. 8.
MacLellan said regulations would be developed under the legislation in consultation with towns and municipalities where the line is located that would address access, ownership and potential environmental concerns if the rails are removed in the future.
"We want to keep this line on the ground ... and if we don't act, it's going to be gone."
In August, the government created an advisory committee in a bid to save the line. The committee includes representatives from the three levels of government and is tasked with finding ways to increase traffic and improve the business case for a private operator to take over the line, which runs between St. Peters Junction and Sydney.
An interim report is due in December, with a final report expected in the spring.
Genesee and Wyoming did not return a message for comment.
President Mario Brault has said the $2-million annual subsidy provided by the province is no longer enough to make up for a continued decline in freight traffic.
The legislation is supported by the Opposition Progressive Conservatives and the NDP and was welcomed by the mayor of the Cape Breton Regional Municipality, Cecil Clarke.
"The only way to ensure continuance of rail in the long term is the development of new industry," said Clarke in a statement. "That will remain the municipality's top priority."
Clarke pointed to the need for continued development of the port in Sydney and projects such as the Donkin coal mine.