Correct circuit element alternative to transistors
If I understand what you need, you can do something as simple as this:







simulate this circuit &ndash; Schematic created using CircuitLab

Signals Vx and Hx are the inputs from the Arduino indicating that the x'th vertical and horizontal motor should be enabled. Signals phi0 -- phi3 are the control signals coming from the stepper controller. Signals dr0 -- dr3 are the outputs to the 4 drive transistors for the motor.

You don't need a separate "switch" for each of the four phases. A single switch (AND1) can control enabling all 4 phases.

And, so far as I can see you don't need "isolation like a relay" (galvanic isolation). You just need signal isolation between the two sets of inputs.