Osaka - Good food, bars, nightlife, shopping
Hiroshima - History, peace, trams, Miyajima
If I were pushed I’d say Hiroshima, as I loved just pottering around the city and Miyajima (iconic floating Torii gate island) is a short trip away and it’s great, if a little touristy. You can climb the mountain on the island in about an hour if you want to escape the crowds/deer.
Some people love Osaka and it can be really fun, but I think it’d be better with people who know where they’re going. It’s a bigger, more industrial city, with fewer decent sightseeing spots imo.
I really recommend going to a ryokan (Japanese inn) in the mountains somewhere, but it adds a lot to your budget (about 10,000 yen each a night, plus whatever transport).