Freight railroad companies and unions representing workers have been locked in a dispute over pay and working conditions, and come Friday, the conflict could spill over into a logistical crisis, affecting not only commuters who rely on the railway to get to work but also the nation’s energy supply and drinking water.