It's difficult to get an armed squad into a cart right now. Nothing will stop them from shooting if you can manage to do it. They won't jump out of the cart until it is safe. In general, I haven't set up an interface to ride squads or random citizen groups around in carts. The haulers can ride them, but it isn't a full passenger service. That could happen at some point, but there are things to think through.
The workaround that immediately comes to mind (for marksdwarves at least) is to assign them to have their equipment on them at all times, then give them (and only them) the hauling job. I don't remember if you can do this in the military screen, or if you need to also give them a hunting job to make sure they always have ammo on them, but it is possible. For
nobles random citizens, you might have to turn off all the hauling jobs of the other dwarves until they accept a hauling job, and then you can vault them to wherever you want them, like
the middle of the ocean an underwater paradise.
It looks like an automated marksdwarf driveby defense system will be possible, and not even that difficult. I typically burrow my citizens during siege time anyway, so (if I understand Toady correctly) if there were some defense system minecarts which took off from an unburrowed starting point, and the marksdwarves were unburrowed and assigned only hauling jobs, they would jump in the minecarts, take a ride, see an enemy, fire, and repeat. You could even put them on a looped track and have them fire until they ran out of arrows or enemies.