Overnight in the hotel at KIX isn't a bad idea. Here's another one, especially if you have no baggage to carry around. Go to a hotel in Osaka Umeda area. Buses from the airport go to that area until past midnight. Figure the hotel is just a place to sleep and don't worry about the quality level. Next morning you'll be much closer to Kyoto (30-minute train ride) as compared to KIX. Spend the day in Kyoto and then head back to KIX straight from there.