https://en.wikipedia.org/wiki/List_of_United_States_cities_by_population
Actually, Jacksonville's city proper is the 12th largest in the country as you can see in the table above. It's just that the city limits of Jacksonville are much larger - the population density of Jacksonville is much lower than Buffalo's. When you compare metro areas, you are correct, Buffalo and Jacksonville are much closer.