We consider groupoids constructed from a finite number of commuting local homeomorphisms acting on a compact metric space, and study generalized Ruelle operators and $ C^{ast} $-algebras associated to these groupoids. We provide a new characterization of $ 1 $-cocycles on these groupoids taking values in a locally compact abelian group, given in terms of $ k $-tuples of continuous functions on the unit space satisfying certain canonical identities. Using this, we develop an extended Ruelle-Perron-Frobenius theory for dynamical systems of several commuting operators ($ k $-Ruelle triples and commuting Ruelle operators). Results on KMS states on $ C^{ast} $-algebras constructed from these groupoids are derived. When the groupoids being studied come from higher-rank graphs, our results recover existence-uniqueness results for KMS states associated to the graphs.