Those who are sent in the service of our government should get priority.
Followed by those who want to leave and make some effort to do so.
In both Afghanistan and Sudan, many of those Americans left behind either chose to stay, or just didn't cooperate with the evacuation effort. In both countries Americans were warned for years previously that it was very dangerous and unwise to travel there. Those State Department travel advisories are there for a reason.
I know a little about this, it was covered when I served in the Peace Corps. We were in Nepal during that nation's civil war. At the time the war was small and localized, we just stayed out of the districts with fighting and it was perfectly safe. (it really was, never felt the least threatened by that war, even as it expanded and got worse.)
But we did have plans for what to do if the situation deteriorated. So did State Department and other U.S. government staff. It called for a gradual staged tightening of security. First we would all meet up with the other PCVs in our district in the district capitol. If things didn't resolve then from there travel to the national capital. If things still didn't resolve we would all move into a State Department compound. If things still didn't resolve, fly out of the country, possibly via U.S. military.
Later we modified it and suggested that if things went bad very fast, then volunteers posted near the Indian border could just cross the border and check in from there, presumably to travel to Delhi and from there back to the U.S. The problem (the civil war) was in Nepal, not India. It was not dangerous to take a bus from the border to Delhi. I was posted a 15 minute bike ride from an Indian border crossing, but it took me 27 hours by bus to get to Kathmandu, so the India evacuation option seemed pretty sensible to me.
And that kind of thing usually works, unless things go bad very fast. That happened in Albania in 1997. Things went bad so fast that the PC and State Department dependents couldn't get out of the country before it became unsafe to try. They did have enough time to get to the capital and into the embassy (guarded by the embassy's Marine Corps detail and Albanian guards supervised by those Marines). They stayed there a couple of nights until a
larger Marine Corps force showed up at the door. The Marines drove them in an escorted convoy of busses to a beach where helicopters picked them up. The choppers flew them out to chartered passenger ferries and they were in Italy by the next morning. From there they flew commercial back to the states, most within 48 hours.
They can move fast when they need to.
So as best as I can tell, most of the Americans in Sudan are there because they ignored all advice to get out earlier or to just not go there in the first place. Many of them will be dual citizens who live there, it is their home. Others are missionaries or aide workers who either understood the risk or were naïve and blind to the risk - even though it would have been explained to them many, many times. The plans for getting people out exist and usually work, start with dependent families and non-essential personnel (so the Peace Corps gets evacuated early, if they are there). Then more state department until it runs a skeleton crew. Then finally the Ambassador and the last top tier staff and the Marines. That usually works, nobody but nobody wants to fight the Marine detail.