Both of your Pokemon will gain EVs (2 spdef in this case), as well as any other Pokemon of yours that participated in the battle, Pokemon of yours holding the EXP. Share will also gain those EVs, regardless of whether they participated in the battle or not.