Enabling/Disabling 24V using sensor and relays
I think your requirements can be tabulated as shown in Table 1.
Table 1.
State     S1  S2  OUT
=====     ==  ==  =============
    1     Hi  Lo  OFF
    2     Hi  Hi  ON
    3(a)  Lo  Hi  ON (latched until State #1)
    3(b)  Lo  Lo  ON (latched until State #1)

Since 3(a) and 3(b) give the same result when S2 is either way we can simplify to Table 2.
Table 2. (x = don't care.)
State     S1  S2  OUT
=====     ==  ==  =============
    1     Hi  Lo  OFF
    2     Hi  Hi  ON
    3     Lo  x   ON (latched until State #1)




simulate this circuit &ndash; Schematic created using CircuitLab
Figure 1. This seems to satisfy the requirements of your question.
Note that contact RLY2b has been left in for clarity but it may be omitted as contact RLY2a will provide the same function.