Fuel is energy. Engines turn it into work/power. Work or power required is determined by drag (both aero and friction) and incline.
Proper gear choice and driveline loss will make any two engines near identical, assuming both will produce power in excess of what's strictly required. A smaller engine has far fewer challenges to efficient combustion and extraction of that energy. From friction down to the dynamics in the combustion chamber. Larger bores, longer strokes, and engine weight will all play into the calculation and so yes there is a balance, but the 'smallest capable design' will always win the fuel consumption competition.
An over-sized engine will generally be more durable and easier to operate. But that has exactly zero to do with maximizing MPGs.