In 1761, UP wasn't hostile territory for the Marathas . In fact the Mughal ruler of Delhi was under Marahta protection .so what you are saying rohilla ditched marathas ( as far i know they were already at war with them) .
.
.
who send lakhs of women and children to a hostile territory like up ?
what a coincidence they all end up in pani pat which is well known battle ground .
sounds like a face saving story .
.
.
marathas are use to of fighting mughals who hire mercenaries , some from here some from there etc in their army.
they underestimated afghans who were hardcore fighters .
BTW Before Panipat , marathas had reacted Attock in pakistan .
Battle of Attock (1758)
https://en.wikipedia.org/wiki/Battle_of_Attock_(1758)
And maratha civilians were going to temples in UP for pilgrimage for years . But It was arrogance on the part of the marathas who didn't take Abdali too seriously and wanted to negotiate with him rather than fight , that's why so many civilains went with the maratha army .
But in panipat , their supplies were cut off and they got tied down too many civilians , when Najib-ud-Daula and more importantly Shuja-ud-Daulah Subedar Nawab of Oudh , who was friendly with the Marahtas switched side .