The rail connections there aren't great. (For historical reasons, the railway lines tend to point towards Moscow, rather than to each other.)
You can get (slowly) from Warsaw via Białystok to Kaunas and Vilnius, with a single change at Mockava on the border. There are no direct trains from Lithuania to Latvia. And the journey from Riga to Tallinn is quite indirect. Probably only worth it if you want to visit Tartu.
Buses are very good, and I used the bus from Tallinn to Riga, and Riga-Vilnius. About 4.5 hours each. I used Lux Express, but there are other operators.
Here's a useful guide to the journey:
Poland-Lithuania https://www.seat61.com/trains-and-routes/warsaw-to-vilnius-by-train.htm
(That page also has links to the onward journey to Riga and Tallinn.)
I was there a couple of months ago. Any questions, please ask. They're all really interesting countries and cities. Worth the effort.