Looks like you want to use the Azerbaijan one. To find this, I went to Rome2Rio's page on Tbilisi to Baku. This then shows the train option with Azerbaijan Railways (ADDY)
$6 - $20 USD
And links to the rail website showing movement of the trains.
However it notes that "Buy tickets at ...
I made this journey in 2017 and took the overnight train from Tbilisi to Yerevan. It cost approx 90 GEL in first class, and less in other classes. It has the advantage of saving you the price of accommodation.
It goes from the main train station in Tbilisi to the main one in Yerevan. Tickets can be bought at the international/long distance counter upstairs ...
So, from a few sites I was able to get the following information. This one is the most detailed and includes maps and images, this is also a good source.
It has been said to be the cheapest and easiest way, tickets seem to be around 35 GEL but I haven't seen that anywhere official, as you just pay the driver on the bus. (In comparison a flight is more ...