Berlin, and may I add Vienna, are anomalies. Vienna's population peaked in 1910. Berlin's population peaked in 1943. They were both capitals of an empire at their peak time. Then they became less important, and their population decreased. Now they have been in a very unique situation with their new population growth, because they already were designed for a larger population.
You can't generalize from Berlin and Vienna to other, more normal, cities.
https://en.wikipedia.org/wiki/File:Population_of_Vienna.svg
https://en.wikipedia.org/wiki/Berlin#/media/File:Berlin_popu...