Say you have a Roaring Moon with a stat spread as such: Roaring Moon @ Booster Energy Ability: Protosynthesis EVs: 4 HP / 224 Atk / 252 Spe Jolly Nature This way, Attack and Speed are both exactly 370. Which will Protosynthesis boost?
If multiple stats are tied, Attack, Defense, Special Attack, Special Defense, and Speed are prioritized in that order.
In this case, Attack will be prioritized over Speed. Source: https://www.smogon.com/dex/sv/abilities/protosynthesis/
If a roaring moon has the same attack and speed then the attack of roaring moon will be boosted I did a showdown battle with it and it's attack rose Source