Well, you're kind of guessing on a lot of things, yet you seem very sure that an 0805 resistor, which you think these are, is rated for 125mW.
There are 1W-rated (at 70°C) 0805 resistors. Of course they will run very hot, but they are designed to do that. In the value you have, it's more likely to be 500mW maximum at 70°C. Or perhaps lower rated, but there would be no visible difference.
I would not personally feel comfortable in this particular situation running parts even near their printed specification, but in fact surface mount parts are very sensitive to the PCB details- from tests a very small part can dissipate a lot of power (similar to a much larger part) if mounted over a ground plane. A very large part on a single sided board with thin traces might run hotter than an 0603 part with fat leads, a ground plane etc.
I don't see any redundancy in this circuit so any kind of single point failure- the opto, the wires to the unit, the resistor, the diode could cause failure to recognize the signalling so this is not being treated as a safety-critical device design in the slightest.
(Edit: I do have one suggestion- that you confirm that the input is actually rated at 24V DC. The power dissipation with 24VAC would be about half what it is with 24VDC input.- okay you covered this in a comment)
On the other side of the equation, if the voltage in question is coming from a backup battery bank the '24VDC' might be more like 28VDC which would increase the power dissipation considerably- to more than 850mW. The resistors are close to each other so they will heat each other up.
Do raise this with the supplier.