A book you might find interesting is Along Parallel Lines
by John Gunn. It is a history of NSW railways from 1850 to 1986 and gives lots of details about the financial aspects of the railways, including construction.
A few bits from this book might help you:
An 1873 report to the Secretary for Public Works indicates that John Whitton [engineer in chief] believed that a good railway for locomotive purposes with a 4 feet 8 1/2 inches gauge, might be constructed for £7000 per mile.
In 1880-81 NSW parliament debated a proposed vote for linking the Southern and Northern Lines, a double line of 95 miles between Homebush and Waratah costing £2 755 000.
The Commissioners in their annual report for the year to 30 June 1891 suggested that where the country is practically level and the traffic will be very light, that lines to be designated 'Pioneer Railways' be constructed at a cost of about £1, 750 per mile, exclusive of bridges and land, the trains to be worked at a speed of 15 miles per hour, and during daylight only.
I doubt that an average cost per mile would be a useful figure since, as you suggest, lines were constructed in different terrains and to different standards. Inflation would also have resulted in different costs in different eras. Costs for the construction of individual lines would be interesting.