Several local fire and police departments are working with Union Pacific Railroad to rewrite emergency response plans to include measures for evacuating residents and otherwise dealing with catastrophic oil train accidents like the one in Canada that killed nearly 50 people last year.

“Given the new realization of the increased hazard of the crude oil, it’s caused us to sit down and talk again, but we feel that we’re prepared to respond to any scenario,” said Mark Erickson, assistant fire chief of the South Metro Fire Department, which covers West St. Paul and South St. Paul. But, he added, “we don’t have anything specific to the railroad.”

That may soon change under a new state law, signed by Gov. Mark Dayton last week, requiring railroad and oil pipeline companies to help pay for training and equipment for emergency personnel responding to hazardous materials spills.

Erickson has been meeting with Union Pacific (UP), which owns tracks that run through Inver Grove Heights and South St. Paul, to go over what police and fire departments would do in the event of a ­catastrophe. But he added that, given the area’s status as a major freight hub, local officials had already been working with the rail company to review response procedures.

South St. Paul Police Chief William Messerich said the city has well-established crisis-response protocols for any incident involving hazardous materials.

“Even before some of these derailments happened, we were already dealing with UP on this,” he said, adding that some confusion remains about whether the city will have to augment its existing disaster plans or formulate new safeguards for rail-related accidents.

Under a recently enacted state law, the state will collect $2.5 million annually from railroad and oil pipeline companies operating in Minnesota, money that will be used to train police officers and firefighters to respond to rail accidents involving crude oil and other hazardous materials.

There have been several high-profile rail accidents across the country and Canada in recent years, including fiery derailments in Virginia and North Dakota, and a July 2013 accident in Lac-Mégantic, Quebec, in which 47 people were killed.

The U.S. Department of Transportation issued emergency orders after the accidents in Canada and Virginia, establishing for more ­stringent crude transport guidelines.

“We’re looking at those incidents, and what’s being done in response to those, and saying now that we’ve learned about what was done there, is there anything further that can be done here?” said Erickson, the assistant fire chief.

Mark Davis, Union Pacific’s regional spokesman, said the rail company has already been notifying local emergency officials of the routing, volume and frequency of incoming crude shipments.

“Any first response agency historically, we do provide them information on what comes through their community. And that helps them in the unlikely event that there is an incident,” Davis said.