San Bernardino and Riverside are neighboring Inland Empire cities, but they offer visitors different strengths. Rather than asking which is universally better, decide what you actually want from the trip.
San Bernardino: Route 66 and mountain access
San Bernardino has the stronger connection to classic Route 66 road-trip culture and sits directly below the San Bernardino Mountains. If Lake Arrowhead, Big Bear, railroad history and roadside Americana are central to your plans, its location makes sense.
Riverside: a different urban experience
Riverside has a more concentrated historic downtown and landmarks such as the Mission Inn. It can feel easier for a visitor who wants to park and spend time exploring a central district.
You can visit both
The cities are close enough that this does not need to be an either-or decision. With a car and several days in the Inland Empire, use each for what it does well.
I would spend San Bernardino time on Route 66 and the mountains, then give Riverside a separate half or full day rather than constantly driving back and forth. The interesting part is seeing the Inland Empire on its own terms.