OH, fortification, right. Sorry, it was 25%.
So you had 25% fortification on both units, flat ground, 105% cultural defense and the choice between a pikemen and a CGII longbow?
From what we know, the total bonus to the longbow should have been 200% (70% from being in a city plus 105% cultural plus 25% fortification), and the bonus to the pikeman should have been 230% (100% vs. mounted plus cultural and fortification). Since the HA can't have cover, and you said it didn't have shock, its promotions shouldn't make a difference, as they'll apply equally regardless of which unit defends. The only possible promotions relevant to the odds of winning for the HA are shock and the combat line. Since the base strength of the longbow and pikeman are the same, the bonuses should tell the story. My suspicion is that you've overlooked one or more factors that bring the longbow to at least parity in bonuses with the pikeman.
Your claim that the pikeman was promoted to CGII suggests that you aren't remembering the details accurately, so forgive me for making some suggestions contrary to what you've already told us about the situation.
1. If the unit was a horse archer-replacing Numidian Cavalry, its 50% melee bonus would reduce the pikeman's bonus to 180%, but leave the longbow's bonus at 200%.
2. A CGIII promotion for the longbow would bring both units to 230%. I have no idea of the algorithm for choosing between equal defenders, and would probably select the pikeman given the choice (assuming other attackers present that the longbow would probably be better suited to defend against), but the selection of the longbow is at least plausible here.
3. The presence of a hill under the city (not always obvious from the graphics) would bring the pikeman to 255% and the longbow to 250%. Similarly, a shock promotion on the HA would result in a net 25% for the longbow, reducing the pikeman to 205%. This doesn't get us all the way to longbow selection, but combined with some other factor, for instance the pikeman being only 20% fortified, or being a little bit dinged from an earlier fight, it could be the culprit.
If you have the save, go back and look for these things. An easy way would be to mouse over each unit and see what bonuses are listed for each. What strikes me as funny is that your longbow was easily beaten. Even as you describe the scenario, the longbow should have had between a 2:1 and 3:1 strength advantage (combat V HA yields 18.00 v. 9.00; unpromoted HA yields 18.00 v. 6.00). Your pikeman would have probably lost, too, if it was an easy win for the HA.