Not quite clear why 12 relays are used in the photo. As Cam suggests, no doubt there's more going on than what's been posted.
Anyway, I like Cam's approach (8 relays). Should meet the requirements that have been so-far described.
Here's a similar approach using 12V DC (instead of 24V AC) as the "control" voltage. I don't suggest this unless you're a determined DIY'er since it requires working with and soldering small components. But it can be done for about $10 out-of-pocket and only uses 4 relays. Again, this is posted in the spirit of kicking around ideas being that OGR is a discussion forum...
This uses low-cost solid-state optocouplers (vs. electromechanical relays) to detect the presence of brick voltage. The 4 optocoupler transistor outputs are connected in series so all 4 optocouplers must be triggered to present ~12V DC to the 4-channel relay module. This relay module is about $1/relay and the relays are 10 Amps. These are single-pole relays so this assumes the outer-rails of all the blocks are in common; Cam's diagram uses double-pole relays which switch both center and outer-rails. As Cam suggests, you can bypass/over-ride one or more bricks by placing a toggle switch at the output of the respective optocoupler.