Whenever a Pokémon gains experience, it also gains EVs, including any modifiers to its EV intake like Pokerus, macho brace, and power items (assuming it hasn’t reached its EV limit). Because every Pokémon in your party gains Exp in SwSh, regardless of whether it fought or not, they will also all gain EVs, so yes.