Certainly can be made to work, however, bear in mind the switching time for the relay(s) - guessing in the order of 5-10ms (I'll let you do the math on that). Place a series resistor in line with the +supply of the sensor, ground-to-ground. That gives you a monitor point at the supply terminal of the sensor that is the input into the comparator. Choose the 24V flavour of the comparator board and it's all pretty straight forward. The choice of series resistor needs a little consideration - I'd start with a 100R - if (my assumption) the sensor is a switched constant current sink of 1mA / 200mA then that would give a switching voltage swing of 23.9V down to 4V at the sensor supply line.

It's a bit of a sledgehammer solution but it provides all the function that you need in a very handy prebuilt module. If it's affordable to you then it's a valid solution.