To give a full 24V signal, you need either a two transistor circuit, or you can just use a darlington optocoupler - we use those to provide floating signals for PLC inputs.
A 4N32 is suitable; use the existing hall signal to switch the LED, with a resistor in series to set the current.
Then connect the output transistor between 24V and a PLC input.
That device has a high current gain, a minimum of 5x, and the output transistor is rated up to 100mA and 30V.
I'd aim for around a LED current around a third of the maximum PLC input current to ensure the transistor is saturating.
Example
Order today, ships today. 4N32 – Optoisolator Darlington Output 5300Vrms 1 Channel 6-DIP from Isocom Components 2004 LTD. Pricing and Availability on millions of electronic components from Digi-Key Electronics.
If you wanted to use transistors:
Use an NPN transistor with base connected to 12V, a 10K resistor from emitter to the hall sensor output and another from emitter to 12V.
Then a PNP transistor, emitter to 24V, with 10K resistors base - emitter and base to the collector of the first transistor.
The collector of that goes to a PLC input.