So, I finally got around to drawing up a simple circuit using a bridge rectifier.
As mentioned in the comments, there are SMD bridge rectifiers for low current available for about the price of a single transistor. I can order a bridge rectifier that costs less than a 2N3904 from the same supplier.
The blue section represents whatever is generating the 24VAC.
The red section represents the microprocessor input, with clamp diode to 5V and 100 kOhm as the input impedance.
The AC-detector is really just the three resistors, the rectifier bridge, and the capacitor.
The three resistors reduce the 24VAC to something that will be a little over 5V when rectified.
They also limit the current that can reach your processor in case you get more than you expected on your 24VAC.
This is the simulation:
You can't see it, but the current through the clamp is less than 1mA (red line across the bottom.) So, probably safe enough to let the clamp diodes on the processor's input handle it. If not, a schottky diode is pretty cheap.
The voltage builds up a little slowly. That's about 75 milliseconds before it hits 5V. Ought to be fast enough, though. The decay when the 24VAC disappears ought to be similar.
That's a cheap, dead simple AC detector that offers at least some protection against over voltage.
Probably as cheap as if not cheaper than the transistor based circuits.