About that I am partially sure that city production is based on leader flavors not on city needs.
No. There are several Need/Want/Enough overrides in the game that override the normal Flavor logic. What happens is that under NORMAL conditions, the AI will use the Flavor ratings. But if the AI crosses a certain threshold it'll categorize a certain thing as a higher priority (Want or Need depending on how severe the shortcoming is), and will override the Flavor ratings to force that type of thing to be produced more often. From what I can tell, some of these thresholds depend on some of the leader's settings (with the Mongols having a very high point before they drop from Want to Enough on military), others depend solely on the era. So from the sound of it, the Mongol player was still stuck in Want mode for military units, and therefore wasn't even checking the flavor ratings for buildings.
I've done a bit of testing and tweaking on this. For instance, the Need/Want/Enough triggers for Workers are automatically disabled after a certain Era (Renaissance, I think); before then, the game will attempt to have each civ have a certain number of workers out in the field, and if there aren't enough, it'll make more no matter what the relative flavor ratings are. But after that era, the game will disable the Need and Want categories for tile improvement and let the Worker's flavor rating (which is very low) treat it like any other unit.
This wouldn't be so bad, except that my mod created three new Eras and I'd often start a new game in those later eras. The AIs (especially city-states) simply wouldn't make workers, because you'd already passed the point where the hard override went away and the Flavor ratings took over; you might get one or two eventually, but no more often than any other unit type. So I extended the Need and Want categories to the end of the game.
From what I could see in the AIDefines files, this sort of logic is also applied to production, gold, etc., to where an empire short on gold won't just shift every city's tile allocation to "Gold Focus", it'll also emphasize more gold-producing buildings, just like a human player would. My point was that adding a new flavor precludes this sort of override, but the normal flavor logic should work when a city isn't in one of these hard override modes.