That's not how it works.
If the PSU has 240V going in, it will have 24V going out.
If the PSU has 100V going in, it will still have 24V going out, but more current on the input.
Check the PSU for what tolerance over voltage it can take, but if it goes to 250 as an example, this does not correlate to a higher output voltage.
If this is a very sensitive PLC and needs protection, I would add a 24V DIN rail mount UPS feeding it.