Will relays work to switch between two circuits which power same LED string?
Generally the idea will work. You will need 2 relays that toggle between output  A and B. 

A----o\    o-----B
       \
        |
        C


In the unpowered state the relay will connect the common pin to output A. This will form your switch state for the 12V backup supply. The relay is powered by your 230V Circuit A, if the relay is powered it will connect the common pin with output B.

What could create a problem is the moment the transition occurs. You may need to make sure your buck/boost circuits will not create peak voltages, especially if the switch condition is bouncing.