Some fishes certainly can learn by observation, but in this case I believe it was a combination of factors that are more related to their instinctual behavior than learning ability.
Tetras are mid-water feeders, and would prefer to eat from that level given the option (look at the position of their mouths), but when put in competition with upper level feeders they will gladly feed from the surface rather than miss out on a meal.
As for the change in swimming position in the tank, it is likely that the presence of more fishes makes them feel more comfortable, in that tetras are schooling fishes and there is comfort in numbers. Also, the normal behaviour of the gouramis clues them in that there are no predators around and it is safe to come out. In some cases, though, newer fishes might simply have usurped the tetras' normal territory, so they have to hang out somewhere else. But that case tends to be pretty obvious.
My neon tetras began schooling much better when I removed the zebra danios, who were constantly disrupting their school, and even more so when I added a dwarf gourami. Whether they see him as a potential threat or what, I'm not sure, but he certainly makes them form a nice tight school.