But how does the aircraft know what "straight" is? Is it via rollout mode or via heading/track data sent to brakes?
Well not rollout, because this (braking) feature is available even without an ILS.
So maybe the IRS, although I cannot find whether the autobrake is unavailable if all IRSs have failed.
Or possibly wheel speeds, as applecrumble suggests, although if the runway was contaminated and the anti-skid was operating, the directional control might then go pear shaped?