If you sink ~7000 Euro into a Bahncard 100 first class, you can go mostly anywhere for free. So by the logic of only counting marginal costs, it’s 25.4 € more expensive to travel from Berlin to Frankfurt by car as opposed to railway.
Berlin to Frankfurt takes about 4 to 5 hours. For the car, this is time spent driving. For the train, we may have to subtract about 30 mins waiting in Leipzig or Hanover for a connecting train, leaving you with 3.5 to 4.5 hours in the train. At a modest 15€/hour, your car trip is now 77.9 to 92.9€ more expensive than the train journey.
But there's two problems with this:
The actual marginal cost of the trip is still 25.4 €, plus let's give it a generous maintenance cost putting it at around 50 €. That's still less than half of the cost of the ICE. Add to this that you now have a car which can carry five people and the costs don't increase at all per person. A trip with 5 people is still going to cost you that 500 € instead of 615 €.
The second problem is that this is when you're buying a new car. Buying a used car would very easily bring your 247 € cost down below that 123 € even with the increase maintenance costs.