I could honestly go both ways on gyms and trials. Both have their faults.
Pokémon get more EXP form gyms, than trials one thing that disappointed me about SM is that battles with Trial Captains are optional. First time playing I kept asking myself are the captains going to fight me only to be disappointed that they didn't, than when I saw you CAN battle them, I was disappointed because all of their teams are kind of bad. The only captains that was per se a challenge were: Illima (Due to a few pokemon being available at that point), Acerola, and I guess Mina. The Totem Pokémon and Grand Trials are more challenging.
However Trials are more fun than Gym Battles. I'm a blood knight, so I like to fight as much as I can, but the adventures in the trials were fun (Mainly Mallow's Trial) and the Totem Pokémon are ESPECIALLY challenging (Really only Salazzle and Lurantis are a challenge the others aren't so bad).