In a generic aircraft system, it would be difficult to have a ‘flat' battery. I am assuming that by flat, you mean that if it were removed from the system and tested there would be little or no potential difference (voltage ) across its terminals.
In the first place, thankfully this is fairly rare and would probably indicate a mechanical breakage or fusing of its internal conductors. Without sophisticated detection, such an occurrence would probably go unnoticed in flight. The detection would have to know the difference between a typical trickle-charge and, for instance, a sudden zero charge as the battery fails by going open circuit. A thermal runaway or a short to a hot bus bringing the voltage to zero, would be horribly apparent.
When the system, (see TR mode above ) ceases to cause a stabilized voltage to which the battery would be held, and a demand is made on the faulty battery, the fault would become apparent. In the real world the first you would probably know about a sick battery would be when you most needed it.
If circumstances allowed, I would make a point of checking the batteries twice. Once with no load, and then again with a few items to load it. It wasn't standard procedure then, but I got used to seeing a certain voltage for each condition and it told me a lot about the battery condition.