Seventy-seven rail cars of Indiana hay, part of a farmer-to-farmer drought relief effort, arrived here today with only one hitch -- a gaggle of politicians scrambling to steal the limelight and the credit.

A loudspeaker blared "Happy Days Are Here Again" as the train, donated by the CSX Transportation Co. and manned by a volunteer crew, eased onto a rail siding with its gift cargo from Indiana for this state's drought-imperiled livestock.

The 2,000-ton shipment was the largest in an unusual, spontaneous relief effort that has brought hundreds of tons of donated hay from 39 states on begged, borrowed or volunteered trucks, trains and planes.

A convoy of 27 trucks donated by the Monsanto Co. was scheduled to deliver 350 tons of Michigan hay to farmers near Greenville today. Scores of tons are en route from other areas, although agricultural officials say the contributions will scarcely meet the needs of the state's drought-devastated farmers and their starving cattle.

"The real stress hasn't got here yet," said Jamie Spears, a young cattleman from Richland County who waited under a broiling sun for his allocation of 100 bales of top-grade Hoosier alfalfa hay. "What do we do come wintertime? I've fed everything I grew last year. We have a 20.8-inch deficit of rain, and I've got nothing in my pastures. I've just been hoping and praying we survive."

Gift hay continued to flow into the entire Southeast, where officials estimate that crop and livestock damage will hit $2 billion or more in the worst drought on record, a disaster compounded by intense heat through most of July.

But as the massive haylift continued, editorial writers and other critics chafed at public officials' eagerness to hitch themselves to a grass-roots movement noteworthy for the absence of government organizers and planners.

As Spears and a few other farmers gathered in the railyard here to collect the first symbolic bales, a small political extravaganza unfolded before them.

The big blue-and-gray CSX locomotive inched into view with Indiana Lt. Gov. John Mutz (R) and South Carolina Lt. Gov. Mike Daniel (D), both running for governor, waving from the front platform under their states' flags. Speeches in praise of the haylift went on at length. Dozens of television cameras whirred. Planes and helicopters bearing photographers buzzed overhead.

South Carolina Gov. Richard W. Riley, a Democrat who cannot seek reelection, stood to one side of the limelight. He abbreviated a proclamation declaring it Hoosier Day, read a short speech and approved delivery of a bale of hay to lie in state, draped in an Indiana flag, in the capitol.

Agriculture Commissioner Les Tindal, also an elected Democrat, boarded the train earlier to verify the quality of the Hoosier hay. South Carolina cows, accustomed to fescue, were about to be spoiled, he said: "It's phenomenal when they send us the best stuff they've got."

The drought has created other hoopla. Rebuffed in his request for an Air Force plane, Sen. Ernest F. Hollings (D-S.C.) arranged for Federal Express to fly a load of Massachusetts hay here a few days ago. His election opponent charged Hollings, who had criticized the White House, with playing political dirty pool. Rep. Floyd Spence (R-S.C.) has been accused by his rival in the House race of not doing enough to help.

Similar spearthrowing has gone on between Kentucky and North Carolina. Kentucky Gov. Martha Layne Collins (D) and Rep. J. Alex McMillan (R-N.C.) got into a long-distance shouting match over who should receive credit for a shipment of Kentucky hay to North Carolina.

The tone apparently was set last week by President Reagan during a stopover here to help Rep. Carroll A. Campbell Jr. (R-S.C.) in his gubernatorial campaign. Reagan and Campbell posed with bales of hay unloaded from an Air Force cargo plane diverted for the occasion from its destination near Greenville. The brief Air Force haylift, authorized by the White House, ended last week.

The credit-seeking spectacle prompted an editorialist in today's edition of The State, a major local newspaper, to wish a pox on all of the politicians. "If South Carolina farmers get adequate relief," the editorial said, "they would do well to follow the advice of Persian poet Omar Khayyam: 'Ah, take the cash and let the credit go.' "

Amid the political sniping, a team of volunteer state employes, who have worked without time off for the last 12 days, fielded dozens of calls from around the country, accepting offers of hay and arranging transportation.

"I've never seen anything like it. I've sat on that phone and cried," said Lanoe Branham, a state agriculture department official. "This is not about federal aid. The fact of it is there is a movement in this country. I sense it. It is about needing and caring and loving and helping.