How can I be successful at Lana's trial?
Solution 1:
First let's look at Araquanid's weaknesses.
It has the double type of water/bug, so it is weak against electric, flying and rock moves. Torracat has none of these, but you have Flaaffy and Pichu as electric pokémon, so that's a good starting point.
A second thing to know is stat-related: Araquanid has a low base speed. Even when this stat is powered-up at the start, it stays quite slow.
But here's three problems:
Flaaffy has a good special attack stat, but it will not be faster after Araquanid's power-up.
Pichu is quite weak in special attack (as it is a baby-stage pokémon), however it will be faster than Araquanid.
Neither has very powerful electric moves.
Knowing that Araquanid is at level 20, I'm guessing your pokémon are around this level.
So I will conclude with some tips based on your situation:
Level up your team. Flaaffy evolves at 30 into Ampharos and Pichu evolves with happiness into Pikachu. Both are, of course, stronger.
Teach Charge Beam (TM57) to Flaaffy and Pichu, that move should be more powerful than anything they should know at that point. This move can be found at Brooklet Hill, at the south of the second trial pond. (So the trial you are currently trying to do)
And I will end with more general advice for anyone with the same problem but with a different team:
Level up your team.
Use healing items, like Super Potion.
During the battle, Araquanid can summon a Dewpider or Masquerain. I think the best strategy would be to focus only on Araquanid to defeat it as fast as you can.
Catch fast pokémon with electric moves, preferably electric type pokémon giving a power bonus of x1.5 at electric moves (This mechanic is called STAB). Araquanid is also weak against flying and rock type moves, but it has water and ice attacks, so flying and rock type pokémon could be defeated easily.
Give your pokémon berries (such as Sitrus Berry), which can heal them when their HP decreases below 50%. However watch out for Bug Bite from the helper Dewpider and Masquerain who will upon successfully hitting your pokemon with this move eat the held berry.
Solution 2:
In addition to @iArcadia's suggestions, here are a few more that might be helpful:
Catch a flying-type pokémon and give it a Flynium-Z so it can use Supersonic Skystrike. In Ultra Sun and Moon, this can be obtained immediately after you beat your first Grand Trial, as Ten Karat Hill (where it can be found) no longer requires Machamp Shove to access.
Use the Roto Boost power that your rotom-dex can generate for you. This will increase all of your active pokémon's stats by one stage.
Use moves that will slowly drain Araquanid's health, such as moves that will poison it or Leech Seed. Note that Araquanid is immune to burns, thanks to its Water Bubble ability.
Use physical moves instead of special ones. Araquanid has a high Special Defense but a low (physical) Defense.
Araquanid's Water Bubble ability combined with the Rain both power up its Water-type moves. A bulky water-type pokémon of your own will be able to take more hits. A grass-type would also resist these water attacks, but the Araquanid also has bug and ice attacks that would hit it super effectively.
This is probably one of the hardest fights in the game at this early stage, so don't feel bad that you're having difficulty with it. Good luck!