Ok, do the decoders look like these ESU LokPilot V4.0 21 pin decoders below? These are 6 function decoders that will operate all the lights correctly on 071/201 models.
I'm a bit baffled by the cab lights working on F3 and F4. They are directional and should switch on/off using only one function, not two separate functions one for each cab end. This suggests perhaps the decoders have accidentally had functions remapped.
As a process of elimination I would suggest resetting one of the decoders by writing 8 to CV8. Don't forget this will put the loco address back to the default of 3, so either test as loco ID 3, or change the address back to the loco running number you previously had. I could be wrong, Irishthump knows a lot about programming ESU decoders, but as far as I can remember function latching is determined by decoder programming rather than cab settings. Assuming the decoder reset changes nothing, then perhaps a read of the Prodigy advance manual may be in order to see how functions may be mapped on the hand held cab. I once accidentally used the wrong CV when adjusting the volume of an ESU sound decoder, and caused the lights to misbehave (i.e. flashing). I had no idea which CV I had messed up so a decoder reset CV8=8 at least brought it back to retail-in-the-box defaults.