LEDs and weird results from various Arduino pinModes
On Arduino, digitalWrite serves two different purposes:


If used while pinMode is set to INPUT, using digitalWrite(pin, HIGH) enables the internal weak pull-up resistors (20 k Ohms) on the respective pin.
If used while pinMode is set to OUTPUT, digitalWrite does the obvious, sets the respective pin to high or low as expected.


Thus, not explicitly setting pinMode (as is happening in your second and third test cases) results in one of two possible outcomes, depending on what the pinMode was last set to, or its default value at power-up, INPUT.

So without the pinMode(pin, OUTPUT), your digitalWrite code is enabling and disabling the weak pull-up resistors, thus raising and lowering the voltage at base of the transistors. This is expected behavior, and depending on the transistor parameters and any additional circuitry, the emitter/collector circuit should conduct (or not) based on this.

The critical missing factor here is the basis for the voltage seen by the base of each transistor - this is relative to its emitter, thus for any consistent test case evaluation, the emitter ground in your circuit needs to be connected to the Arduino ground.

If the emitters do not share common ground with the Arduino board, the base voltage is totally arbitrary, and the only relationship that holds true for this design is defined by the presence (and current through) the pull-up resistors. 

In the serial data connection use-case where things were working satisfactorily earlier, the most likely reason is that the serial cable (or its shield) itself was providing a ground connection that was common with the ground of the power source: Not an ideal design, but it worked by happenstance.