I think the solution is much simpler than Grag38's estimation. You could do it with nothing more than the four LEDs, four transistors, three buttons, a few (6~8) resistors, and a very small Arduino (like a Nano or a Pro Mini.) Box B needs nothing but the two LEDs, the button and the cable connector. You could almost do this without a microcontroller at all. But in this modern age, it is easier to program a sophisticated microcontroller. 30 years ago we would have done it with discrete TTL or CMOS logic gates.I would add a function to allow box A to detect and signal a cable/Box B fault. It would be trivial without adding any extra hardware.