Since VGA is backward-compatible with CGA/EGA, the only way to use both in a single machine is if the VGA card is configured as monochrome afaik.
Otherwise the VGA card will use the same I/O addresses and memory range as CGA/EGA, and they can't work together (there are separate ranges for monochrome and colour).
Normally if you want to install a VGA card into a machine with onboard graphics, you switch the onboard graphics into MDA/Hercules (monochrome) mode if possible.
Does the MDA monitor also use same IRQ as the CGA, EGA, VGA i tried by flip the onboardswitch to MDA but it does not work.
But you think that switch VGA card in to monochrome will?