See the Department of Energy's report "Theoretical Minimum Energies To Produce Steel for Selected Conditions" [1] and compare with the numbers in the wikipedia article on energy efficiency in transportation [2].
The table on page 15 lists the megajoules per ton required to produce steel with various amounts of scrap content. When made with 100% recycled scrap, steel requires "only" 1,289 megajoules per ton. Based on that wiki page rail requires 150 kilojoules per metric ton kilometer so a ton of steel costs only about 75 megajoules to transport a thousand km.
Large container ships use half that much energy so even if the steel scrap must be shipped overseas and back ten thousand km, it'd still be under 400 megajoules for transportation versus over 1,200 megajoules for recycling. The rest of the costs like sorting are negligible.
In practice it takes at least 2,500-3,000 megajoules per ton of steel since the scrap has to be mixed with other sources of iron when there's not enough scrap to go around. The number for aluminum are a lot worse, on the order of ten times more megajoules per ton to extract alumina from ore via electrolysis versus smelting aluminum scrap, which already requires 10x the energy of steel.
[1] https://www.energy.gov/eere/amo/articles/itp-steel-theoretic...
[2] https://en.wikipedia.org/wiki/Energy_efficiency_in_transport