The market solution is to increase the price paid for hauling grain to a level exceeding the cost to haul oil.
And then increase the price of both above the cost to build more rails.
A better "market solution" might be to break up the railroads and undo the last 30 years of consolidation in the industry, then grant a blanket waiver for any environmental permits on projects involving restoration of tracks on abandoned rights-of-way. That would provide some additional rail capacity faster than anything else.
P.S. This is why the U.S. railroad industry remains so heavily regulated even after a heavy dose of deregulation in the 1980s.
Oil and refined products account for about 5% of the total Rail carloads in the US
http://www.freerepublic.com/focus/news/3198100/posts
8/28/2014
Eight of 10 of the carload commodity groups posted increases compared with the same week in 2013, including petroleum and petroleum products with 16,396 carloads, up 28.4 percent; grain with 18,721 carloads, up 17.6 percent; and nonmetallic minerals with 40,279 carloads, up 10.5 percent. The commodities that posted a decrease were coal with 115,050 carloads, down 3.9 percent; and chemicals with 30,003 carloads, down 0.1 percent.