There should be of course separate line of techs and/or improvements, that upgrade militia. Something like City militia-City watch-City guard line, adding better armour and weaponry and chars, that would be great. Still, militia could retain some weaknesses compared to regular units (init? accuracy?), but it would greatly improve cities as true bastions of power, as mentioned.
Some factions could even get some of these militia techs from the beginning (e.g. Defensive trait?). Maybe on higher difficulties all AIs would get the first one for free, to prevent early rush?
It would even sharpen the strategic choice: should I focus on offensive regular techs or turtle militia techs?