Diode to keep from shorting a battery, would it work?
Here is a simpler way:-







simulate this circuit &ndash; Schematic created using CircuitLab

When SW1 is open D1 is forward biased, so the motor gets 36V (less forward voltage drop across D1). When Sw1 is closed it adds the 6V battery to make a total of 42V, and D1 is reverse biased so it disconnects the path between the batteries.

For lowest voltage drop when SW1 is open you should use a high current Schottky diode. When SW1 is closed there is no diode loss, so you get maximum boost!