Sorocabana Railway Company was inaugurated in 1875 and was run by Hungarian entrepreneur Luís Mateus Maylasky, who secured the necessary funding from the Empire of Brazil to put the railway into operation. Poor management and the high cost of maintenance led the company into huge debt, which had to be paid off by loans. With the crisis in cotton production, Sorocabana's financial situation worsened, and in 1880 the imperial government, its largest creditor, intervened in its administration. As a result, the company's headquarters were transferred from São Paulo to Rio de Janeiro, the capital of the country at the time, where it was subject to stricter fiscal oversight.
In December of the same year, banker Francisco de Paula Mayrink, one of the richest and most influential men in the Empire, took control of Sorocabana. Mayrink intended to extend the railway down to the coast to end São Paulo Railway Company’s monopoly. The construction of this stretch of railway was crucial for Sorocabana, enabling it to move production from western São Paulo to the coast without relying on the English company. In 1892, Sorocabana absorbed Ituana, which had been ruined financially, putting an end to the rail transport rivalry in the inland areas of São Paulo.
The railway construction project that would connect the inland areas to Santos was authorised by the government in 1895, but lack of resources prevented it from happening. In 1901, administrative irregularities were uncovered, including embezzlement and theft of building materials. Therefore, federal intervenor Francisco Casemiro Alberto da Costa recommended the sale of Sorocabana. Without an offer that could cover the debts, the government decided to retake the reins and appointed as its manager engineer Alfredo Maia, who already oversaw the Central do Brasil Railway.
In 1904, Sorocabana was put up for auction and sold to the then Federal Government, which handed it to the State of São Paulo. In 1907, it was leased to a French-American group, directed by American investor Percival Farquhar, which controlled other railway companies in the Brazilian states of Paraná, Santa Catarina, and Rio Grande do Sul.
With the onset of the First World War in 1914, the invested capital that financed Farquhar dwindled and his companies plunged into a dramatic crisis. The situation rapidly deteriorated and he filed for bankruptcy in the United States that same year. In the following years, the Federal Government of Brazil and the states from the South of the country tried to retake the main railroads that used to be run by Farquhar, fighting the many lawsuits brought against him both in the United States and in Brazil.