Mixing brands or ages of batteries can cause problems if the batteries are in series. Parallel connections are okay.
When the batteries are in series, the lowest capacity battery reaches full charge first. The voltage starts to rise, which should reduce the current. But the other batteries aren't fully charged so their voltage is still low. The result is a high voltage across the smallest battery which causes it to bubble and lose water, even though it's supposedly a 'sealed' battery. It dies a horrible death and the problem sometimes dominos to the next smallest battery until the UPS finally realizes that something's gone horribly wrong.
Note that in your pictures, the dead battery is shown as 7Ah, possibly 7.0 Ah based on the part number, while the Yuasa battery is 7.2 Ah. Could be marketing or different measurement methods or it could be that the Yuasa battery has a slightly higher capacity.
Some APC UPSs are known to have too high a charging voltage. They want to recharge the battery ASAP in case there's a second failure so they overcharge the batteries. The batteries recharge quickly, but it shortens their lifetime.