The problem here is that currently Greece suspended all the international trains, thus it obviously complicates your task a bit. But still you can always catch a domestic Greek train to Thessaloniki (cheaper to buy your ticket online), from there bus to Sofia (for instance -
http://www.union-ivkoni.com/razeu_v-1-323 or check on
http://ktelmacedonia.gr). While from Sofia it's already easier, since you can get direct train to Bucuresti (app. 25 EUR). Bucuresti-Deva is also relatively easy to do by train, fare depends on when you purchase your ticket and specific train chosen.
In terms of timing it will take almost whole day to travel Athens-Thessaloniki-Sofia, then overnight to Bucuresti + 8-9 hours by train to Deva from there, so in total doubt you can make it in less than 30 hours.
p.s. there is also plenty of direct buses from Greece (including those from Athens) to Romania, they might give you a better timing since go straight without need to change means of transport, but such option hardly can be called a comfort journey, imho.