Automatic Switching of Power Supply to
If you can live with 11.5 volts at your output you could use this: -



It drops only half a volt between input and output and you can set the FB pin for it to naturally produce 11.5 volts by adjusting the 1 Mohm and/or the 88.7 kohm resistor.

Or just use a buck-boost regulator capable of delivering a regulated 12 volt from a range of input voltages below 12 volt to above 48 volt.