Diagnosis would be much easier and more likely to be correct if you provide all of the symptoms and the conditions under which they occur at one time. I used to suggest to customers that they keep a piece of paper and write down when the symptoms occur, with a list of items like vehicle speed, how long the vehicle had been driven, ambient temperature, weather, speeding up, slowing down, right after getting gas, etc. By writing this stuff down, a pattern may appear which will help in diagnosis.
An EGR problem is not likely to cause the engine to lose power at 40 MPH.