The nation received new hope yesterday of some relief soon from soaring inflation rates: The government reported that farm prices declined in July for the first time in nine months.

The Agriculture Department announced that prices received by farmers dipped 1 per cent over the month, chiefly because of declines in prices of cattle, hogs, corn, soybeans and lettuce.

Analysts stressed that it may be as late as September before the dip begins to show up at the retail level. However, economists say supermarket prices already have begun to slow, and the inflation picture should improve.

The sharp rise in food prices this year has been the major cause of the surge in consumer prices, which so far has sent inflation climbing at an 11.2 percent annual rate.

The increases so far have been sharper than the administration expected. But White House economists have predicted the inflation rate will taper off the rest of this year as food prices begin to moderate.

The department confirmed yesterday that because of the steep increases in farm prices in the first half of this year, food prices now are likely to rise by 10 percent for 1978 as a whole - the top of its previous forecast.

However, department economists said they still expect food prices to moderate visibly during the remaining months of the year. Earlier, the agency had predicted food prices would rise between 8 and 10 percent.

The figures came as, separately, the Commerce Department reported its index of leading indicators, whose behavior is designed to foretell changes in economic activity, rose 0.4 per cent in June, continuing the previous trend.

The index had climbed 0.1 per cent in May and 0.9 per cent in April. In June, six of the 10 indicators available turned in positive performances, while three others declined and one remained unchanged.

Those showing improvement included the length of the average work week, vendor vendor performance, change in total liquid assets, change in sensitive prices, stock prices and building permits.

The three that declined were contracts and orders for plant equipment in 1972 dollars, money balance adjusted for inflation and new orders. Only the layoff rate remained unchanged from the previous month.

The July decline in farm prices stemmed primarily from a dip in livestock prices, which began edging down in early summer as supplies of marketable cattle began to increase again.

Yesterday's figures on the leading indicators brought the overall index to a level of 136.3 per cent of its 1967 average.