For "the second/third beautiful city, we can write
Die zweitschönste Stadt
Die drittschönste Stadt
What about the 45th most beautiful city?
We can probably write
Die 45. schönste Stadt
but how do we write it in full (or read it)?
I recommend to rephrase the statement in German, but this is difficult if you want to avoid to use the noun „Stadt“ twice:
It may be particular for that specific example, but IMHO, those sentences bear a ironic / sarcastic connotation, since the "45th most beautiful city" is quite far away from the "most beautiful city". It sounds like "the 10th winner" (out of eleven competitors...). This applies all the more to a "literal translation":
Since „fünfundvierzigstschönste“ is very uncommon in German, it draws the attention even more to the mediocre rank (IMHO).
I would say / write it like this:
I also have my doubts about the correctness, since anything above 12 is uncommon.
Never thought about it (native German speaker) :)
You would probably try to avoid doing this, because there is no elegant way to say "45th most whatever". Up to "zwölft (12) schönste Stadt" it works very well, but not beyond. If you have doubt: Please give me a practical example when you would need such a phrase.