When will you travel?
Maybe during a busy tourist season?
A Japan Rail Pass
(7-day Ordinary Class: 29110 yen, paid in your currency)
is not recommendable,
because it is much more expensive than JR regular fees for the itinerary planned at present.
Unless you are eager to reserve your seats
(even when it is not necessary),
a JR-West Kansai-Hiroshima Area Pass
(5-day: 13500 yen when booked through the website)
is suitable.
https://www.westjr.co.jp/global/en/ticket/pass/kansai_hiroshima/This pass can be used
also for your JR Limited Express Haruka train ride without seat reservation,
on your way from or back to Kansai Airport [KIX].
In a case
where your Special Rapid train ride from Kyoto to Osaka or Shin-Osaka
is outside the 5 days of the validity of this pass,
you just pay 560 yen as the basic fare.
(This JR-West pass
is not valid on the Tokaido Shinkansen section Shin-Osaka -- Kyoto,
which is operated not by JR-West but by JR-Central.)
For the other way from or back to KIX,
you can choose
a JR-West Haruka discount ticket
(for your ride without seat reservation)
or a Nankai Kanku Tokuwari Rapi:t Ticket
(for your ride with your seat reserved).
https://www.westjr.co.jp/global/en/ticket/icoca-haruka/https://www.howto-osaka.com/en/ticket/ticket/tokuwari.html