A significant portion of hydrocarbons is transported by rail. At the same time petroleum products are classified as hazardous cargoes, accidents during transportation of which may lead to emergencies. The article gives an assessment of damage from emergencies in the transportation of petroleum products by rail. Assessment of economic losses, as well as damage to the environment. At damage assessment analysis of dependence of environmental damage from the time elapsed from the moment of emergency situation till the beginning of localization and liquidation of transport emergency was conducted. Technical solutions to ensure safety have been developed and proposed. The use of the proposed devices will increase the safety of transportation of petroleum products by rail. As a result of the conducted calculations the possibility of using a complex consisting of two proposed devices to ensure safety during transportation of dangerous goods has been established.