Mt. Koya (Koyasan) has been getting popular destination in these days. Most common way to Mt. Koya is Nankai Railway line. It takes you to Gokurakubashi station where is located at the base of Mt. Koya. You may transfer to the funicular to Mt. Koya.
If you use JR deals, such as JR Pass (nationwide pass), Kansai area pass, Kansai Hiroshima area pass and other JR West passes, you cannot use the pass because Nankai Railway is not JR. If you do not use these JR deals, you may use other deals, such as Kansai Thru Pass, Koyasan World Heritage Pass.
You may use these JR deals partially to get Mt. Koya if you want.