Well, my first "squad" (consisting of the dorf nominated carpenter after embark, but with no training) did not become captain of the guard [No, wait, he became king, so I replaced him as emergency axe wielder, but that still was before I got a mayor]. However, I DID get a captain of the guard when I created the second squad, which happened AFTER I had been saddled with a mayor. My conclusion is that existing militia are not automatically elevated, but generation of new squads after getting a mayor will get you one. I was holding off getting a sheriff until I get a proper jail (with metal chains, as I've read strong dwarves can break fiber ones).
However, it seems my squad shuffling worked, so my Captain of the Guard is now a featherwood crossbow equipped weakling with no military training, and the actual militia (which is under training) has been moved to a new squad.
There are (at least) two reasons I want a military even though I want all enemy killing done via devices:
1. I want to be able to explore caverns while keeping the civilian population from swarming out into them to collect various creature remains (i.e. restrain the civilians with a civilian alert).
2. At times my device killing isn't perfect, and I need someone to mop up. Ballistae, for instance, rarely, if ever, kills. Instead the enemies are knocked unconcious, and I've never seen any of them being hit while prone.
3. Shit happens, and someone is needed to take care of it to save the rest of the fortress (buy time to close the gates).