One stone reportedly even fell inside a coach.
Rahul Gandhi was aboard coach C-3 of the train and was not injured.
The 38-year-old Congress leader chose to travel by train as part of the party's austerity drive because of the drought in many parts of the country. He was travelling by air-conditioned chair car.
The elite Special Protection Group (SPG) personnel accompanying Rahul Gandhi had immediately searched the affected coaches and directed railway authorities not to stop the train at Panipat junction.
Haryana is ruled by a Congress government led by Chief Minister Bhupinder Singh Hooda.
The state goes to assembly elections next month.