If the train power supply is a relatively-constant 12 Vdc supply, simply feed the two 12V terminals into a bridge rectifier. The output of the bridge will be the same polarity no matter what the input polarity is.
If you are concerned about the voltage drop in the bridge, create your own bridge rectifier using 4- Schottky diodes. Choose appropriate diodes ...
H bridges are for driving high current coils or motors. You have no current limiting R.
CMOS (74HC family ) has about 50 OHms driver R so you can include this with your current limiting R.
Since Iv intensity in xxxx mcd is common now , the curent can reduced to a few mA for indicators with a single Rs = 470 to 1k.
Here is how I drive bi-color LEDs:
simulate this circuit – Schematic created using CircuitLab
Use a logic family that can source or sink 20ma or whatever you need to drive the LEDs. I actually don't use inverters (that solution was closest to your circuit), but a serial to parallel shift register (like a 74xx591) to drive 4 bi-color LEDs using the 8 ...
For 99% efficiency choose Ron <= 12 mOhm = 1% of 12V/10A=1.2Ohm with logic level gate drive of 3.3V.
With millions of FET choices this usually means Vt (=Vgs(th)) is ~ <=1/3 of Vg=3.3 or Vt< 1.1V to start looking from with a filter range.
The fact that they're Schmitt triggers is largely irrelevant. Putting two of them in series like that is doing two things for you:
It's converting the logic levels from the 3.3 V of the RPi to the 5.0 V that the MIDI interface requires.
It's isolating the RPi from any bad things (ESD) that might come in via the MIDI connector.