A pokemon earns EVs in every battle (excluding wifi battles obviously), with or without pokerus/power items, and so, even if you don't battle selected pokemon to select the stats in which you'd like your pokemon to gain EVs, they will still earn EVs across all stats. So, at a high level, after your pokemon have battled many other pokemon, it will reach 510 EVs and you will get the Effort Ribbon. You won't know how many EVs are in each stat though. Hope this helps!