Even though the concept of Gym Battles has been replaced in The Alola Region with that of Island Trials, each Trial is still led by a Trial Captain, one that specializes in a given type. And even though you don't Battle these Captains during their given Trials, you can still battle all the Trial Captains found within thee game at some point or another.
Trial Captains
Captain Ilima: After defeating Team Skull in the Hau'oli City Marina, Captain Ilima will challenge you to a Battle. After defeating Kahuna Hala in your Melemele Island Grand Trial, you can face Ilima again at the Trainer School (first visit him in his house in Hau'oli City).
Captain Ilima (Hau'oli Marina): Level 9 Yungoos, Level 10 Smeargle
Captain Ilima (Trainer's School): Level 15 Gumshoos w/Normalium Z, Level 14 Smeargle
Captain Lana: After defeating Lana's Trial, you can Battle her sisters in the back room of their house in Konikoni City. After defeating them, Lana will come and you can battle her.
Captain Lana (Konikoni City): Level 26 Chinchou, Level 26 Shellder, Level 27 Araquanid w/Waterium Z
Captain Kiawe (Pokemon Sun Only): After defeating Kahuna Olivia in your Akala Island Grand Trial, you can find Kiawe in his house in Paniola Town at night. You will end up following him to the Thrifty Megamart where he works, only to see in get let go. He will then challenge you to a Battle to lift his spirits.
Captain Kiawe (Royal Avenue): Level 26 Growlithe, Level 26 Fletchinder, Level 27 Alolan Marowak
Captain Mallow (Pokemon Moon Only): After defeating Kahuna Olivia in your Akala Island Grand Trial, you can find Mallow during the day in her room above the Konikoni Restaurant. You will end up following her to Lush Jungle, where she first asks you to find a Wimpod before she'll Battle you. After finding one, her brother will mention that he needed her to do some shopping for him, but asks you to tell her just to bring Wimpod home. Meet her back in Lush Jungle and she'll finally battle you.
Captain Mallow (Lush Jungle): Level 26 Phantump, Level 26 Shiinotic, Level 27 Steenee
Captain Sophocles: After defeating his Trial, Sophocles will mention that he would like to Battle you one day. That, however, won't happen for the longest while, until you're Champion and he's one of the many numerous trainers wanting to battle you after you Rematch the Elite Four.
Captain Sophocles (Pokemon League): Level 61 Togedemaru, Level 61 Magnezone, Level 61 Electivire, Level 61 Vikavolt, Level 61 Golem
Captain Acerola: The first Time you'll ever Battle Acerola will be one of the Elite Four Members. You can then Rematch her at will by challenging the Elite Four again whenever you please.
Elite Four Acerola (Pokemon League): Level 54 Sableye, Level 54 Drifblim, Level 54 Dhelmise, Level 54 Froslass, Level 55 Palossand w/Ghostium Z
Elite Four Acerole (Pokemon League Rematch): Level 63 Sableye, Level 63 Drifblim, Level 63 Dhelmise, Level 63 Froslass, Level 63 Palossand w/Ghostium Z
Captain Mina: When you first meet Mina, you won't Battle her. Actually, you won't even take on her Trial as she has yet to decide and create one. Instead, you won't battle her until after the main storyline, in both the Ultra Beast Storyline and on Poni Gauntlet. Her team will remain virtully the same in both encounters.
Captain Mina (Route 8): Level 61 Klefki, Level 61 Granbull, Level 61 Shiinotic, Level 61 Wigglytuff, Level 61 Ribombee
Captain Mina (Poni Gauntlet): Level 61 Klefki, Level 61 Granbull, Level 61 Shiinotic, Level 61 Wigglytuff, Level 61 Ribombee w/Fairium Z