The difference between 25 and 40 € isn't that big. Depending on where exactly you are and want to go in Helsinki/Tallinn, it may well be more convenient to take a train.
Heck, people ride the metro for nearly half an hour to get downtown for beers. If I can get to a decent Tallinn pub in less than an hour door-to-door I'd probably go now and then, depending on how late in the evening I can get back home.
For those who don't know, alcohol and restaurant food are around half the price in Tallinn compared to Helsinki.