So I want to back up a little bit here before I answer your question directly to talk a little bit about some basic economics. Specifically, I want to explain the concept of opportunity cost. Essentially, Opportunity Cost is the difference between whatever you're acquiring, and what you could be acquiring if you were doing something else.
Why is this relevant? Let's look at your goal for a second: You want to acquire flasks as cheaply as possible. Now, there are two 'currencies' at work here. There's gold, which you use to buy them, or components thereof on the Auction House, and there's time, wherein, someone with Herbalism as a profession goes out into the world and farms herbs to either make their own flasks, or sells them straight on the market.
You seem to be operating under the assumption that an Herbalist who makes their own flasks using materials they gather is somehow getting them at a reduced price, or even 'for free'. This is an erroneous assumption. The herbalist is 'paying' the same market price as you are for their flasks - by not putting them on the market, the opportunity cost is identical to the gold the herbs would've cost if they had spent that time farming something else and used the gold to buy the materials outright.
What does this mean to you? This means that asking for the most cost effective source of materials is, after a fashion, missing the point. While there are a variety of tricks that you can use to buy herbs at below market rates, these generally fall into the realm of social and economic game playing that rests outside of the scope of what an answer here at Arqade can provide. The short answer is: make standing relationships with people too stupid to sell their products at market rate. Offer to buy in bulk at a discount, and camp in trade chat in hopes that a chinese farmer/botter is unloading their product at any given moment in time.
In reality, the better question to ask youself, is what activity do you have access to that provides the highest return per/minute/hour/session/whatever of gold. Feel free to rule out some of the most efficient activities if you find them too tedious or inaccessible. In some cases, the absolute most profitable activities, such as doing Jewelcrafting dailies for tradable, and high demand Jewelers gems back at the start of the expansion, are highly rate limited. The gold/hour is sky high, but you only get to do them once a day. In other cases, such as with farming for a high demand crafting mat via say, fishing, there's no limit to how much you can do. The point is that raw, liquid, fungible gold is what you should always be measuring your economic activities in. For many players, especially those without access to a gathering profession, the best and/or least tedious method is simply doing dailies or running instances. Whatever activity it is that you choose, do that, and buy the materials or goods you need.
For instance, if I needed Silk cloth in large amounts, I could go farm low level zones for an hour until I have the 10 stacks I need, and earn another 100 gold in incidental 'stuff'. Or, I could go do my max level dailies, earn 2000 gold, buy the 10 stacks of silk cloth for 20g/stack or 200g total, and pocket the difference of 1700 gold versus farming the low level stuff.
Now that said, you asked if there's a more cost effective way to actually make the elixirs, and in this particular case, there is. As you noticed, the price of the flasks is often the same or lower than the price of materials. This is because most people selling flasks on the AH are mass producing them after specializing in Elixir Mastery. Elixir Masters, when crafting, have a random chance to receive double, triple, quadruple, or quintuple their yield. On average, you'll get a 25% higher yield from Elixir Mastery.
Put another way, by buying materials and crafting yourself, as an elixir master, you get a 25% discount on all of your elixirs. That's the best deal in town and you won't do better than that.
So to answer your question more directly: Do whatever it is that yields the most gold for you, and use the gold to buy herbs. Make your own flasks. That's the most cost effective way to do it.