We don't know the length of Tom's sentence, or even whether it was a sentence (as opposed to incarceration for therapy purposes, to be terminated when the patient is cured). But Garak got six months for attempted genocide, in the literal sense of the word rather than the modern twenty-counts-for-entire-genus one. If that was a sentence, then any legal system where the punishment fits the crime ought to treat attempted coup with relative lenience. Three months? Two?
In comparison, Dick Bashir did explicit prison time, at least by his own words, and he knew the length of that time beforehand so the odds of it being a sentence are higher than those of it being to facilitate getting better. This is a big aberration from all other incarceration in modern Trek (overnighters or symbolic cool-off periods in the brig, another half-year stint for smuggling, etc), and more in line with the pre-TOS jail sentence of Mike Burnham. But perhaps Bashir's ancient crime deserved an ancient punishment? Or then it was well known that no therapy would help with that particular type of crime, so the criminals got the maximum allowed 24 months and then were let to walk, and not to Elba II, either.
Timo Saloniemi