In a scenario where the barbarians win, and where the strength of the activated knights of both players is the same, both players lose one city.
What you presented isn't such a scenario.
The strength of the barbarians is equal to the number of cities (including metropolises) owned by all players.
The strength of barbarians is 2 + 1 = 3.
All active knights of all players [...] will defend against the barbarians. [...] Remember that the strength of each knight is based on its type: basic (1), strong (2), or mighty (3). Sum up the value of all the active nights to determine the strength of the defending army.
Assuming both knights are activated,
A: 1 × 3 = 3
B: 1 × 3 = 3
The strength of the defending army is 3 + 3 = 6.
If the knights have strength equal to or greater than the barbarians, the knights win and Catan is saved!
The barbarians actually lose in the scenario you presented.
If 2 or more players tie for the highest total strength of knights, [...] each of the players who tie for the highest strength draws the top card from any 1 of the 3 progress card stacks (his choice).
You each have a strength of three, so each get a free progress card.
If you each had one basic knight rather than a mighty one, both A and B would contribute a strength of 1 for a total of 2, and you would have lost. (Again, this assumes both knights have been activated.)
If various players tie for having the lowest total strength of active knights, each of those players loses 1 of his cities.
You each have a strength of one, so each player would lose a city in this scenario.