BMW 3-series mysteriously loses power on freeway

I’d bet on the fuel pump. When they’re starting to fail, they can start acting up when they’re hot. A long drive on a hot day with a low fuel level is exactly a recipe for that (as the fuel helps to cool the fuel pump).