Currently there are no trains running from Riga to Tallinn, which means that there is no way to get from Vilnius to Tallinn by rail (unless you want to change trains in Russia, which explains the 38 hours quoted above).
To get from Vilnius to Tallinn there are 2 options:
1. By bus (2 direct busses per day)- see
www.eurolines.lt, www.eurolines.ee or
www.eurolines.lv
2. By plane. I know that AirBaltic offers great prices between Riga and Tallinn/Vilnius (see
www.airbaltic.lv). One problem you might encounter is that these routes are operated on weekdays only. Riga-Vilnius is only Tue, Wed, Thu. But then, you can always stop for a couple of days to enjoy Riga.
Let me know if you have questions.