"“She can own property; she can serve in the military; she can get a job; she can pay taxes. But she can’t vote, and she didn’t know that.”"
https://www.nytimes.com/2017/02/10/us/illegal-voting-gets-te...
It is a tragedy that this was not made abundantly clear to this woman, assuming she truly believed that she was permitted to vote.
Consider that there are towns in rural California with majority noncitizen residents. In cases upwards. of 90%.
See:
https://en.wikipedia.org/wiki/Right_of_foreigners_to_vote_in...
https://www.washingtonpost.com/opinions/noncitizens-are-gain...
You make it sound as if they just happened to wind up there at random, and have nothing else in common.
Geographic proximity is incidental to belonging to a group. The land they live on is merely one of their possessions. Allowing visitors does not mean they must share their sovereignty with them.
To answer your question, in democracies, each person can vote to influence their own nation - their demos, even while abroad. You think demos should be decided purely on current location, but most countries disagree - they use mostly jus sanguinis, with the exception of jus soli in the Americas.
How do we ensure non-citizens aren’t voting? We accept many visitors - refugees, H1B, tourists, F1/I-20, etc. None are granted voting rights.