You do this, initially, by placing steel girders across gaps in the levels.
In that way, it's up to you to keep each of the Mini Marios safe as they mindlessly trudge towards the exit. The problem is, should they ever come across a cliff, bad guy, or pit of spikes, the minis will just walk straight into it, and meet a mechanical end. Upon starting the level, and touching each of the Mini Marios to get them going, the mindless bots will simply walk in a straight line through the level, only turning around should they hit something. Mario vs Donkey Kong: Mini-land Mayhem is actually a puzzle game, similar in form to Lemmings.
You can stretch girders from one giant red screw to another.