According to History Matters, the Supreme Court's 1886 ruling in the case Wabash, St. Louis & Pacific Railway Company v. Illinois overturned a previous case that allowed states to regulate railroads. It led to the formation of the Interstate Commerce Commission in 1887. The case asserted the Constitution's authority that the federal government regulates interstate commerce and not the states.
At issue were fees paid to the state of Illinois by the railroad company. Illinois charged the railway more money to transport goods from Gillman, Ill., to New York than from Peoria, Ill., to New York even though Gillman was 86 miles closer to the destination. The state of Illinois wanted the right to charge the transportation company for the Illinois portion of its journey. The Supreme Court had no issue with cargo or passenger runs that stayed within Illinois' borders, but took issue with the longer journey to another state.
The railroad claimed it was discriminated against with regards to higher fees. The Supreme Court agreed and deemed the corporation had civil rights as enumerated under the Fourteenth Amendment, even though the amendment pertained to freed slaves. The court also believed that the railroad participated in interstate commerce because the journey started in Illinois and ended in New York. This case effectively deregulated the railroad industry within each state.