The nitrifying bacteria will grow on both gravel and on media in filters. They will grow preferentially where there is more of what they need: food and oxygen. That tends to make filter media a preferential place for the bacteria to grow. In reality, though, they probably can be found on just about any surface in the tank that isn't devoid of oxygen.
You're making a mistake, I think, in your belief that a different kind of bacteria grows on the gravel vs. on the filter media. In deep beds of the substrate, you might find other types of bacteria (the denitrifying bacteria mentioned by mome rath) but the bacteria found on the upper surface of the gravel will be the same as those found on the bioballs. We would expect them to be more populous on the biomedia, though, given the constant supply of food and oxygen.
Make sense?
Jim