Militias are a thing. We mean standing armies. No one is saying we just let the imperialists walk in and conquer us. It means people should be able to live and work wherever they want, unhindered by borders. An invasion is something else, and would be defended against by community defense and militias
Through coordination with the communities of others. Militias have and are very effective at fighting conventional standing armies. Look at the viet kongs, the anarchist militias in the Spanish Civil War, and the Ukrainian Black Army. Or the slave rebellion of Haiti. Even modern day, the Zapatistas hold their own against both the Cartels and the Mexican government.