Using MOSFETS for a Level Shifter
If you want to use a logic level to switch 25V, then I'd suggest an arrangement like this - a classic high-side switch.

The voltage divider on the gate of the P-Ch is to avoid Vgs exceeding the 20V limit for that part.







simulate this circuit &ndash; Schematic created using CircuitLab

The update that I've made to the circuit incorporates an extra P-channel MOSFET, M3, and a pullup resistor to 5V, R4.  This can be pretty much any modest P-Ch MOSFET; it should be reasonably fast but it doesn't need to be high voltage or high current.  Its purpose is to convert the open-collector output from your 74LS247 into a 5V logic level.  Alternatively, you could use a pullup resistor (like R4) and an inverter, e.g. a single gate from a 74LS04.

If you could choose a different decoder IC than the 74LS247, one with a logic level output, then you could go back to the previous circuit.

Please do some testing with a single instance of the circuit to satisfy yourself that this does indeed work before you design and assemble a 42-channel version!