Train from Cairns to Sydney is about 1800 miles, and you will have to change in Brisbane. i think Cairns to Brisbane is about 3 to 4 days. Brisbane to Sydney is overnight (or all day).
I'll dig out a bit more, if you like. Fares, for a start, might cause an intake of breath ...