The Su-27 and MiG-29 was designed to meet the same specification set by the Russian air force in the late 1960s early 70s. The Su-27 design was eventually chosen, but then the MiG company suggested that the Russian airforce build both fighters - the Su-27 as a long-range air superiority fighter (like the F-15) and the MiG-29 as a short range fighter (like the F-16) and this was accepted by the Russian air force. The Su-27 has several advantages in long range engagements like more missiles and more powerful radar. In close however the MiG might be more agile (although the Su-27 is pretty agile too). If they were to meet head-on I would say that it would be down to which pilot was the best (I'm not sure if the battle in Africa was at close range or at long range).
It is true that the MiG-29 has not done well against western fighters in actual combat (1991 gulf war and the 1999 Kosovo bombings), but in both cases the MiG-29 was massively outnumbered and the quality of the pilots might not have been as high as the western pilots.
In mock combat during peacetime the western pilots have reported that the MiG-29 can be a handful in close range dogfights if it has a skilled pilot (even more so if the pilot can use the helmet mounted tageting system).
As to which plane is the main air superiority fighter for the Russian air force, I would say the Su-27, whereas the MiG-29 is used more for airfield defense and defense of other high value ground targets.
This is done from memory, so any additions and/or corrections will be welcome