The only nuclear weapons Ukraine would need is enough to reliably ensure Moscow and St Petersburg cease existing.
Do you really think the US would trade Washington and New York for a chunk of Mexico?
Like...that's the whole point of MAD. You might as well ask "well why didn't the US and Soviet Union go to war? Obviously they won't launch..."
The entire point of a nuclear deterrent is it stops people asking those sorts of questions, because ultimately it's a gamble. The only guarantee you get is "don't invade my territory and I won't launch". As soon as you start not doing that, you get to ask if you think it's a 1% chance, or a 2% chance, or or or... You get to find out when your capital and most populous city do or do not explode. And you get to roll those dice over and over again.
More recent events show that it doesn't matter. India-Pakistan endless fight.
And Ukraine. Imagine they had nukes in 2022 and russian army advances. Should they nuke russian cities? It would not stop troops and give them more motivation to fight, to revenge. Should they nuke russian troops? To many nukes need for such large frontline.