It would be very simple to set the default boot drive in Ubuntu
using grub or lilo. ssh is the standard tool for the job. I don't
know enough about Windows to make any suggestions.
The drive boot sector is only 512 bytes. You could keep
a pair of boot sector images on HDD and write the
appropriate image to sector 0 of the HDD before you
reboot.
Something like:
dd bs=512 count=1 if=boot-linux.img of=/dev/xdx
dd bs=512 count=1 if=boot-windoze.img of=/dev/xdx
Make a backup of your original boot sector before you
start experimenting.
Again, you will have to ask the Windows experts how
to do this in Windows.
See the man page for dd, grub and/or lilo.