I have found that a little friendly bribery goes a long way in the tropical countries.
In the Philippine Islands my wife and I went to Manila to get her exit paperwork to return to the states with our new baby. (1975) We stayed two days and visited about 6 or 7 offices, you wait in line to get in, typical red tape. We ended up with a sheaf of documents stamped and signed, all on cheap newsprint.
The PI was under Ferdinand Marcos and martial law at the time.
They would shoot people in the street over misdemeanors. The wife was nervous there.
Off we go to the airport where only those actually boarding the plane are allowed into the customs area, so we said our goodbyes and she left.
Knowing how they were, I hung around for a while to make certain she made it out.
They pulled the old, "your papers aren't in order" on her, and she came back to the fence in tears because they wouldn't let our son leave. He had dual citizenship, as he was born on Clark AB.
I used a method I learned while stationed there- I gave her $50 in $5 bills and told her to try again, and casually hand them this with a smile.
Everything went smoothly after that. In those days, Philippinos average per capita income was about $50 a year. We were viewed as 'rich', even on lowly Air Force pay.
Be careful but a little grease can make new friends right when you need one.
Have some cash- small bills divide up easier.
I hesitate to write this because if you try the wrong official, you can rot in jail. If you're a nervous type, stay away from the 3rd world. Be relaxed and friendly, not too ostentatious, and you'll be ok.
Learn some of their language, too. At least the magic words.
They respect that, same as we do.