Inside the observatory building, head north-west towards the researcher behind the counter. Speak to him to receive a souvenir-- a rare Comet Shard. Next, head through the sliding door at the end. The corridor here is lined with cardboard boxes.
If it's night, follow the corridor west. At the far end, past the Magnemite should be a Zygarde Cell (38) glimmering towards the north. To continue, head through the yellow and purple sliding door just ahead from the corridor entrance.
On the other side is Sophocles's rather eccentric room. Approach the youngster and the trial will begin. He won't bother mentioning it, but the same rules apply: no catching Pokemon and no quitting except if your entire party drops to the floor.
The trial begins rather haphazardly, with an audio quiz that you need to pass to open the security door. Like Kiawe's trial, the quiz is a lot more easier than you might expect.
Anyway, the first answer is super obvious: "Pokemon Center". Choose correctly and the security door will open, allowing a wild Grubbin to ambush you. Use your Fire, Flying or Rock-types to send it scurrying.
The second answer should be just as obvious: "Rotom Dex". This time, you'll be waylaid by a wild Charjabug. The evolved form of Grubbin, this Bug and Electric-type Pokemon is only weak to Fire and Rock-types.
The third question is practically trolling; the answer is: "Charjabug", the Pokemon you just fought moments ago. Choose correctly and you'll be attacked by another Charjabug, just in case you were unsure of your answer.
Actually, the fourth question is pure trolling. We won't insult your intelligence by providing the answer. Choose the correct one and it's time for your fateful clash with Hokulani Observatory's Totem Pokemon!
The final evolution of Grubbin, this Bug and Electric Pokemon also has the Levitate Ability, which negates Ground-type moves. At the start of the battle, Totem Vikavolt is receive a boost to all stats from its aura.
From an offensive standpoint, this battle is tough since Vikavolt is only weak to Fire and Rock moves. The Totem is also carrying an Occa Berry, which reduces the damage from one Fire-type attack. On the plus side, Vikavolt only uses physical moves, despite its stellar Special Attack.
Whenever Vikavolt is alone, there's a chance it may summon ally Charjabug to assist it. These buggers, literally, can use String Shot, Mud Slap and Thunder Wave to hinder your Pokemon. They have the Battery Ability too, but it's useless here.
The easiest way to approach this battle is with a solid Ground-type that can use Rock Tomb--you should have gotten the TM for this move at Wela Volcano Park. Ground-types are immune to Electric moves, which also allows you to evade Paralysis from Thunder Wave.
Ground-types resist Bug moves too. However they cannot by themselves hurt Vikavolt due to Levitate, which is where Rock Tomb comes in. The other thing you can try is hit Vikavolt with a strong Fire-type to remove the Occa Berry, then unleash a powerful Fire-type Z-Move.
Swat the oversized bug and you'll earn Electrium Z, the symbol of your island trial victory. Molayne will reward you as well, by giving you his own Z-Crystal, Steelium Z. Before you leave, Molayne will give you the Professor's Mask to return to Kukui. Real smooth.
A Helping Hand
If you're playing normally, you can't get a Vikavolt until much later. The only way to get a Vikavolt is to level up a Charjabug in the Vast Poni Canyon on Poni Island. However, if you have a friend who's further ahead, you could trade your Charjabug and have your friend evolve it before trading it back.