Upvote:4
I would suggest going back to the source Azerbaijan Railways LTD timetable for local trains:
There is a daily train from Baku to Tbilisi daily leaving Baku @20:30 local time. There is also an express train from Ganja to Baku leaving every other day (English version is incorrect) @9:00. I can't find information about the stops of the fast train to Tbilisi.
If you area looking for other options you can look at the question that @MastaBaba linked:
as well as:
ADDTIONAL INFO
Found a site in Russian which states that train Tbilisi-Baku does stop overnight in Gandja.