Ersatzfreiheitsstrafe, not Freiheitsstrafe.
The assumption behind the question is not quite correct, and I edited the subject line because of this. There is a problem with prison time for fare evasion, but it is not quite the problem the question describes. The defendants are not sentenced to a Freiheitsstrafe, a prison term. They are sentenced to a fine which gets converted into an Ersatzfreiheitsstrafe, a prison term in lieu of a fine, when they "refuse" to pay. Someone who gets a parking ticket, and who simply ignores every letter and payment request, will also go to jail in the end (§96 OWiG).
As the answer by Trish pointed out, the punishment for fare evasion is normally a fine or up to a year in prison. When a range of punishments like that is given, the courts are supposed to use the maximum only in exceptionally grave circumstances. So if the case goes to court, and if the court finds the defendant guilty, the options are a fine or a prison sentence.
For a first offender, a prison sentence is very unlikely. Even if the defendant was sentenced to prison, it would be very likely that for a first offender, the sentence would be suspended and the offender be put on probation. On top of that, the transport operator has the option of collecting a penalty fare and not filing criminal charges, which is routinely done if the defendant had no prior cases in their transport system. If a defendant gets a prison sentence for fare evasion, it is almost certain that there is a lengthy criminal history. More likely, the sentence is a fine.
But there is a problem with criminal fines in these cases.
The German legal system sees a fine as the lesser punishment, compared to a prison sentence or even a suspended prison sentence. That's somewhat counter-intuitive. A defendant who can leave the courtroom with a suspended sentence faces the risk of having the suspension revoked if he or she offends again, a defendant who gets sentenced to a fine has to pay up. But the theory values freedom over money.
When the court passes a criminal fine, there are two elements to the judgment. The fine consists of a number of day-equivalents (Anzahl der Tagessätze) and the amount per day-equivalent (Höhe des Tagessatzes). The number depends on the severity of criminal responsibility, the amount depends on the wealth of the criminal, and they are multiplied to get a total.
The court can set an amount per day-equivalent between €1 and €30,000. Normally, it is set at 1/30th of the monthly net income, or at €5 for people on welfare. In theory, that means both rich and poor people are equally "chastised" by the fine. The more money they have, the more money it takes to make them "feel the slap" from the justice system. And when the criminal does not pay, the fine is converted into prison time at a rate of one day per day-equivalent. It may be possible to pay in installments, or to do social work instead of paying, but prison is the default. Anything else needs to be arranged, which requires at least a passing familiarity with the legal system.
In practice, often it does not work out that way. A typical sentence for fare evasion is around 30 day-equivalents.
- Someone with a monthly income of €10,000 gets sentenced to 30 times €330 or so (the court would not use fiddly decimal points in the sentence). A good lawyer and a good tax advisor might even bring it down a little, but let's ignore that for this example. He or she can pay €9,900 or spend 30 days in prison. A defendant with such an income is extremely likely to be able to pay, either from savings or by taking a loan.
- Someone on welfare might get sentenced to 30 times €5. He or she can pay €150 or spend 30 days in prison. But a defendant on welfare is not likely to have €150 in the cookie jar. A good lawyer might be able to argue for a lower amount per day-equivalent, but the defendant probably won't have a good lawyer who spends an hour to make the case that the fine should be lower by a couple dozen Euros. Either the defendant borrows from friends or family, or the defendant goes to prison, or the defendant arranges to pay in installments, or the defendant arranges the option to do social work in lieu of the fine. Such a defendant is less likely to be able to pay than the defendant in the first bullet point.
- A homeless drug addict would probably ignore the summons to court, possibly get a default judgement at the rate of €5 per day equivalent even if there is a very good case for a lower amount, ignore the request to pay, and gets an arrest warrant. When the defendant is picked up for an unrelated drunk-and-disorderly offense, the arrest warrant shows up in the computer.
(I realize that this sounds disrespectful of homeless people, but it would take a homeless with a very good support network to navigate the legal proceedings successfully. Having no postal address is a massive problem, on top of the other effects.)
So while it is true that fare evasion is more likely to result in prison terms than parking offenses, the correlation is not causation.
Only very poor people are likely to go to prison over either offense, and very poor people are less likely to own and operate a motor vehicle.
That being said, it is recognized by many activists, legal professionals, and by politicians specializing in justice or welfare, that there is a massive problem. The number of inmates on Ersatzfreiheitsstrafe is unclear, but significant, and keeping them there is rather expensive. During the Corona pandemic, the state of Berlin simply stopped administering Ersatzfreiheitsstrafen to reduce crowding in prisons. Now they apply the normal laws again, arguing that "sorry, no cells available" is not a way to approach the structural problem.