I am agreed with you since maraths were trying to rule at Delhi at that time.
Marathas were thinking that by winning the battle of panipat they will become the sole power in India and they will rule all over India. That was the main reason they were fighting against Ahemad Sah Abdalis. Due to this they didn't get the support of other states like Haryana, Paunjab and UP etc. and they were brutally defeted by Afghans.