My master-plan (subject, no doubt, to umpteen modifications) has to combine travel over most-desired sections in daylight; and hopefully, just one night somehow on trains / sleeping rough (budget not allowing "civilised" accomm.)
There are no overnight trains in Ireland, nothing much past midnight and even then only commuter service arrivals in suburbs.
I would strongly advise against rough sleeping in Ireland, with the exception of Dublin Airport there are no transport hubs with anything close to secure areas to stay overnight.
Some of the coach operators have night services but 4 hours is about the longest journey time you would get.
If you are also looking at Northern Ireland as well there is an 01.30 Derry-Dublin coach arr 05.30. Similar services to Dublin are available from Cork, Limerick, Galway, Sligo, Ballina, Tralee, Wexford, Waterford.
translink.co.uk
buseireann.ie
citylink.ie
gobus.ie
aircoach.ie
dublincoach.ie
Beds in dorms in hostels can be had for €10-15 upwards depending on location and time of year, they often include breakfast.
www.anoige.ie
http://www.hostelworld.com/
There are some bus/coach routes that may be useful to connect isolated lines; Rosslare-Waterford, Sligo-Ballina, Sligo-Derry.
buseireann.ie
the 370 Rosslare-Waterford route that doesn't go via Wexford is the replacement for the rail service and it crosses the closed line in a number of places.