Upvote:8
According to Seat61, there's a connection between BiaΕystok and Vilnius (change trains at Kaunas).
From there, you would be able to reach Tallinn in two days, with a change at Riga. But note that since 2020, Vilnius-Daugavpils trains only run to Turmantas at the border, so you may be out of luck after all. This may also be the reason your own searches didn't give any result.
If you manage to get to Daugavpils (bus, taxi?), you can buy train tickets from there to Riga here.
Alternatively, there seems to be a direct bus from Warsaw to Tallinn, which also stops in BiaΕystok. This would take just over 16 hours.
Another option that minimizes time spent on buses is this: