The rising demand for cost-efficient freight transportation, along with governmental policy support for improving railway infrastructure, should benefit both Union Pacific (UNP) and CSX (CSX). But which of these stocks is a better buy now? Let’s find out.Union Pacific Corporation (NYSE:UNP), which is headquartered in Omaha, Neb., and CSX Corporation (NASDAQ:CSX), in Jacksonville, Fla., are two popular railroad operating companies in the United States. UNP hauls agricultural, automotive, and chemical products and offers long-haul routes from all major West Coast and Gulf Coast ports to Eastern gateways, connects with Canada's rail systems and serves the major gateways to Mexico. CSX provides rail, intermodal, domestic container-shipping, barging, and contract logistics services worldwide, and transports chemicals, minerals, agricultural and food products, and coal, coke, and iron ore to electricity-generating power plants, steel manufacturers, and industrial plants, as well as exports coal to deep-water port facilities.