Unlike experience points, EVs are not divided among Pokémon. Any Pokémon that earns experience points from a battle, whether it be from actually making an appearance in the battle, or by simply holding the Exp.Share item, will earn a full share of the EVs earned in battle. So therefore, in the situation that you described, both Pokémon would earn 2 Defense EVs.