In 1860 at the eve of the Civil War, St Louis was the 8th largest city with 160K people. Chicago was a distant 9th with 112K people. By 1870, while St Louis grew to be the 4th largest city with 310K people, Chicago was a close 5th with 298K people. By 1880, Chicago had blown by St Louis with over half a million people, while St Louis still only had 350K.
So, in order to get St Louis basically to switch places with Chicago in the post Civil War era, I think you need a couple of things to happen. There would have needed to be a tremendous amount of industrialization in the South, especially in New Orleans and along the Mississippi. Perhaps this could have occurred in the form of a more radical reconstruction that provided actual capital and opportunity to freedmen that encouraged them to industrialize. Probably a bit far fetched, but not necessarily impossible.
Then, with the river and the railroads, St Louis becomes both a transportation hub the equivalent of NYC, it also attracts even more immigrants and expands even more as an industrial center itself. There were a number of auto makers in St Louis in the early 20th century. If it becomes what Detroit was, then I think you see even greater growth.
Finally, the city isn't short sighted and does not break away from St Louis County, allowing it to expand its footprint as it grows.
With that, the city grows to about 1.5 Million by 1900. 3.2 Million by 1930, and 3.8 Million by 1960. Thereafter, it declines some as its suburbs grow, but by 2010, the city still has 3.4 million, with a metropolitan population of 10 million.