We present a medium-term market equilibrium model of the North American crude oil sector via which we develop a scenario analysis to investigate strategies to mitigate the environmental and public-safety risks from crude-by-rail transportation across the United States. The model captures crude oil movements across rail-roads, pipelines and waterways, while distinguishing between light and heavy crude qualities. We find that restricting rail loads or increasing pipeline capacity from areas driving production will significantly reduce rail movements. However, lifting the United States crude oil export ban in isolation will only increase rail transportation volumes. We show that an integrated policy of targeted rail caps, pipeline investments and lifting the export ban sustainably addresses medium-term crude-by-rail risks in the United States.