Yes, most bacteria get destroyed before reaching the intestines (which is the desired place for these bacteria), but apparently there are some that do manage to survive. This Wikipedia page details probiotics in general. (That’s the golden keyword when doing searches for info about this issue – probiotic).
The bacteria themselves don’t get your digestive track back in line, per se. Yogurt, and other foods which contain probiotic bacteria, help to replenish the bacteria colonies. So say you had an illness that caused you to fully empty your intestines, the probiotics would help to get your digestive track back in line by means of reintroducing the bacteria that call your intestines their home.
One of the probiotic bacteria groups, Lactobacillus, is also found in other fermented foods such as kimchi, sauerkraut, and miso paste.
Be cautious though, “active cultures” is a marketing term that’s meant to convince you to pay more money for that container of yogurt. First off, their claims have never lived up to what they advertise (scroll down to the Yogurts section), and furthermore, like you say, your stomach is going to kill off most bacteria anyway, so the difference between the amount of non-bacteria-added versus bacteria-added yogurt is really negligible. One last consideration: one of the groups, Dannon, that sells yogurt with “active cultures”, also sells Evian water, and everyone knows Evian backwards is Naive, which I feel fits their company precisely.