The circuit that gives the higher-voltage one of the two input signals to output
simulate this circuit &ndash; Schematic created using CircuitLab

Figure 1. Two half-wave precision rectifiers.


Both op-amps will adjust their outputs to drive the inverting input to the same voltage as the non-inverting input.
The higher input voltage, V1 or V2, will drive R1.
The lower input voltage, V1 or V2, will drive its output to the negative rail in an attempt to bring the output down. It will fail due to the reverse biased output diode. This may affect recovery time when it has the higher voltage input.




Figure 2. Input waveforms on top, output on bottom. Note that the output is clipped at about 11 V due to the 12 V power rail.

Thanks to Spehro Pefhany for pointing out the need for power rails on the simulator.



Edit:

I found that I have given an almost identical answer to Passing greater of 2 voltages using 5V signal some time ago.