Why would the Flim Flam bros. sell the obviously inferior cider instead of the more carefully made batches after the contest? Because the barrels that held the good batch were made first and, therefore, stuck under all of the more hastily made cider so they couldn't easily dig them out.
Alternatively, they sold the bad cider because they'd been enjoying good cider for most of the episode.
While nonalcoholic cider does exist in real life, there is another explanation for why no pony gets drunk; equines have a higher alcohol tolerance than humans do, meaning it'd take a lot more to get a pony drunk than a human.
The Flim-Flam bros. lost despite producing more. The contest was for producing the most cider, not the most apple-flavoured mud.
Why don't the Apples limit one mug per pony, if they ALWAYS run out? It seems like the logical thing to do, and it would add a bit more drama in that they don't make enough for everypony. It could simply be that there are more ponies like Pinkie Pie, who buy multiple mugs that stop everypony in Ponyville from getting cider.
Why didn't Rainbow Dash just visit Pinkie Pie and ask for some?
Probably because Pinkie Pie is a well-established Big Eater who tends to gorge herself on her favorite foods super-quickly? All those mugs that she buys probably aren't enough to last the time between her leaving and Rainbow Dash's hopes of buying her own cider being dashed. Even if Rainbow thought to ask, Pinkie Pie probably drinks it all before Rainbow ever catches her.