I recommend to upgrade Windows first, as it will probably check and overwrite the bootloader with its own.
Installing Ubuntu will also replace the bootloader, but with GRUB which usually detects all installed systems and allows you to boot each of them. The Windows bootloader however assumes it's the only OS and does not care about anything else.
Therefore if you install Ubuntu as last step, you will automatically have a (probably working) GRUB bootloader in the end which detects and shows both Windows and Ubuntu.
If you upgrade Windows last, you will have the Windows bootloader which doesn't show Ubuntu and you would have to install GRUB again.