Why doesn't current flow through the resistor in cases where transistors A and B are on?
Because of the small resistance of open transistors compared to the resistor.
Selecting the value of the top resistor and the value of the right resistor you will make such voltage on base of the right transistor that will be less than base-emitter turn-on voltage. Just imaging that left transistors turn into to a very little resistor.