Anarchy already functions in urban societies; anarchy is what we do when people aren't being forced to do something else - which is 99% of what we do.
As for the free rider "problem", that has been discussed many times. It is far less of an issue than ivory towers make it out to be, for the simple reason that most people don't give a rat's posterior about "free riders."
Let me give an example. An ivory tower economist may reason thus: "I shall not arm myself, even though it would benefit me and the people I care about, since it would also benefit 'free riders.'"
An anarchist will reason "If I arm myself, then I and the people I care about are safer. If once in a while I have to defend your sorry ass too, that's just how the cookie crumbles, but it's not going to stop me from enjoying the benefits of self-defense."
Ivory Tower economists spent years writing about the "Prisoner's Dilemma", convincing themselves that there is no rational reason for people to cooperate. Finally, someone was bright enough to say "People actually do cooperate, why?" -- and discovered what are called social norms.
Ivory Tower economists theorize that, due to "free rider" effects, there will be underproduction of public goods. However, a lot of dumb people then imagine that everything is a public good - forgetting that "public goods" are quite narrowly defined.
Security is essentially self-defense, if we exclude weapons of mass destruction. It is not hard to defend oneself and the people one cares about. That's why about a hundred million Americans have armed themselves. The fact that the lazy git next door also benefits is not a deterrent; it does not convert this to a "public good" problem.
Education is emphatically NOT a "public good" - it fails the excludability test. Those who listen to lectures, take notes, do the exercises, and so forth benefit from the education; those who play hoops in the street do not. Spillover effects such as your benefit from research performed by educated people do not convert education into a public good.
Likewise with scientific research; it is not a public good; the primary benefits of scientific research accrue to those who do the research, fund the research, utilize the research, and profit from the research. As a side benefit, you obtain better goods and services - but if that were enough to convert it to a "public good", there would be no grounds to exclude anything from such an all-encompassing category.
If a politician - or one of his tame economists - tells you that the government should do something "because it is a public good," just remember rule #1:
Q: How do you tell if a politician is lying?
A: his lips are moving.