Air freight makes sense when you need to get something across an ocean in less than a month, or across the continent in less than a day. If the US were to invest in running the railroads efficiently, getting a package from NYC to LA in less than 72 hours should be possible - that's fast enough for regular Amazon shipping. If you electrify the railroads you could avoid an awful lot of CO2 emissions.
There are currently already container trains running from China to Europe (or at least there used to, before Russia started a war). It's a viable midpoint between ocean freight and air freight.