I'm not sure about averages, but given the second hand pricing I've seen: I thought after 100 or so megameters, even well maintained internal combustion engines needed maintenance of a price comparable to replacement?
Barring weird parts supply issues rebuilding an engine should be significantly cheaper than purchasing a low mileage crate replacement. Same with transmissions.