Only looking at religion: Sarajevo is Muslim and Belgrade is Serbian Orthodox. Understanding the history of the 1990s in this region, how do you compare these cities? Considering the Balkan Wars in the 1990s, both cities need your attention before you ask which one.
Not sure if this will help, but after spending 2 nights in Istria-Roving (LOVE Rovinj!!! RS Trip - 16 Days Best of E Europe), I returned to Croatia on my own and stayed 5 nights in Dubrovnik. I took 2 different day trips from Dubrovnik - one to Mostar and another to Kotor. Both mid-April 2018.
Kotor was lovely. Gorgeous scenery. Really gorgeous scenery. Unfortunately, I spent too much time looking at scenery due to road construction. In Montenegro, you don't wait a stop light or a few minutes. You wait 45+ minutes due to construction and the 2 lane highway. Glad I saw Kotor (yawn).
I don't think this is a fair comparison - as I've rearranged my future travel plans to include both cities.
Mostar was different in great ways. My tiny tour group of 9 (driver-Croat, one couple from Britain, another from Finland, me-US, single male from Slovenia, and couple from Dubai) had too many border crossings. One of them was stumped why 6 different nationalities were able to cross all borders without fighting. I'm Jewish. I had lunch with the couple from Dubai.
Guess I'm trying to say that...while I've never been to either Sarajevo or Belgrade (hope to remedy this next Spring), in this part of the world, it's not an either/or. It's not like do I visit Venice or Sicily? In the Balkans/former Yugoslavia, Croatia is more coastal fun; Belgrade is inland.