sorta. in the pokemon adventures manga, the pokemon association is the government body that organizes the league challenge and pays the gym leaders' salaries. they also create laws, though mostly just in the context of what is legal in a battle, such as only being able to have 6 pokemon on you at a time.
according to pocket monsters the animation, a book written by the chief writer of the original anime series, gym costs are high and the government/league funding isn't great. gym leaders are also fired if they lose 3 times in a row, so many pay challengers to throw fights so they can keep their position.
and as for alola, there really is no formal government, things seem to be run by the kahunas who are chosen by each island's deity regardless of their willingness for the role, such as nanu who really could care less, but has to perform his duties since he was chosen by tapu bulu, the trial captains don't really need funding because they don't have formal battles or other trainers to pay and instead come up with different tasks or challenges, typically involving the pokemon or environment around them. they retire at age 20, so it's not really a job like a gym leader and is more of a ritual or cultural duty