All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His Slave and Messenger.
A question similar to yours was asked to the Permanent Committee for Islamic Research and Fataawa in Saudi Arabia. It reads as follows: "Is it permissible for a Muslim male doctor to specialize in gynecology and obstetrics, or is this only for female doctors?"
The Committee replied: "If there is a sufficient number of female specialists in gynecology and obstetrics, then it should be restricted to them and it is not permissible for you to study it or to look at the nakedness of women when training, whether in medical examination or surgery. However, if there are not enough female doctors specializing in gynecology and obstetrics to do what is essential in this field, and there is a need for Muslims to specialize in it, then it is permissible for you to study it and you have a legal concession allowing you to see what you need (of the patient's nakedness) during the medical examination or surgical operations. May Allaah bless your efforts, and may His blessings be upon our Prophet Muhammad, sallallaahu ‘alayhi wa sallam, his family, and Companions."
Hence, since you mentioned that there is no dire need for more specialists in gynecology and obstetrics in your country, you are advised to opt for another specialty, such as pediatrics. The fact that there is a shortage of obstetricians in other places is not a valid excuse for you to specialize in it.
Allaah Knows best.