Heh...
This looks like nonsense, but I think it will actually work (turn off the red LED when the green is illuminated, assuming that was the intent!).
The tricks are several:
1. LEDs are photovoltaic. There's nothing wrong with that, apply current get light; apply light get current. How much current? Well, as you might guess, the efficiency is crap. But one important thing: it has to be an LED, because the voltage associated with that current is proportional to the diode type. A green (GaP) LED has a forward drop of about 2V, so expect 1-1.5V before the current runs out. This is enough to forward bias the BJT.
2. The BJT pulls down on the op-amp. But the op-amp input is not biased! Ah, but it is: the input bias current of the LM358 happens to flow out of the input pins, because it uses PNP transistors internally, and that base current serves as bias.
The transistor need only sink a few uA to do this job.
Important for this to work: the transistor itself needs low leakage current. Typically this is in the single nA, at room temperature; expect it not to work at 100C+, say. It also needs high hFE (more than 10, say) to get a good transition, which can be challenging as hFE falls off at low current, but most types are okay.
Tim