The dark blue of the "Cuban" flag nicely matches that used on the background of various UFP flags from the spinoff shows and movies, with the round starfield emblem in the middle. Since the flag is so conveniently (and deliberately) folded, we might postulate it is
just the standard UFP flag, turned into a "rank flag" for Commodore Mendez by the addition of a white Commodore stripe going through it. Today's navies mangle their national flags in a similar way by adding stars or other symbols to create rank flags specific to the rank of the visiting flag officer.
The red add-on there need not be part of the actual flag "in reality"; it could be a separate red pennant instead, hanging from the same pole - another practice from various real militaries, although its symbolism for Starfleet is up to us to choose.
(Agreed, tho, that in Desilu reality they apparently just draped the Cuban national flag there. But that's not particularly relevant for the Trek reality.)
The lighter blue flag could well feature the Starfleet Command banana symbol, in both Trek reality and Desilu reality.