If I understand your explanation correctly, the sensor would be tripped when a truck pitches too far to the left or right, presumably predicting that it had gone too far out of the norm and a derailment was imminent?
I don't have links to the Spanish system or its patents handy, but it was discussed in at least one of the Creeping Lovecraftian Horror threads. It is not the pitch of the truck that is detected, it is the yaw about the center pin, and in the Spanish system the "detection" is nothing more than an emergency trip when the truck yaws past the angle that represents the effect of the sharpest curve on the route.
A more sophisticated 'detection' would take account of the damped yaw rate as well as the absolute angle, since no intended curving would generate fast yaw, and any acceptable sideframe play or other cause of excessive uncontrolled bolster yaw would not have substantial magnitude.
Would the system then initiate an emergancy brake application on its own, or would it just alert the engineer of a problem?
The Spanish system is very simple, just a trip and a mechanical valve. A system that 'warned the engineer' would require all sorts of additional complication -- a separate tone in the radio, some means of identifying where in the train the incident occurred, there are many possibilities that I don't want to encourage a detailed discussion of -- and their discussion noted that if the truck has rotated to the angle it trips the valve, it's appropriate to stop the train in minimum time anyway. I would like to hear from buslist and others if this is indeed the 'best' appropriate strategy, given the expected propagation in the train.
How far would you think a truck would have to be off-kilter before the alarm went off? I've seen a train of empty rock gondolas on a bad track doing pretty spooky looking things. The cars appeared to tip left then right about 12" off vertical in quick succession, at about 10 mph. Would something like that tend to set off the alarm?
No. Only actual yaw sufficient to trip the valve would set the 'alarm', and it would do it by triggering a big-hole reduction propagating from the valve location down the trainline in both directions.
I assume you have seen the Government video on 'how to derail a train'. Three-piece trucks are extremely flexible in pitch, and can tolerate amazing amounts of 'twist' well past the point that the blocks above the roller-bearing housings are tipped in the sideframes without derailing. There is no particular reason to use sideframe pitch alone as a derailment indicator (unless so paranoid about safety that you'd plug it at every tree).
Likewise, harmonic rock should not be used to trigger a mechanical valve, although it might be highly useful to warn an engineer when movement has built up to the degree you indicate -- I'd think 5 degrees of repeated magnitude would be alarming, let alone 12, but I'd defer to professional rails on just how much rock constitutes a need for warning.
Yes, I'd put some kind of small whistle on any mechanical 'derailment detector' valve to make it easy to find the 'anomalous car' at zero-dark and wet-thirty. Perhaps cheap battery-powered lights near the sill, too.