John Nieslanik is a classic example of why it is so hard to balance the federal budget -- with or without the Gramm-Rudman-Hollings law that mandates it be balanced by fiscal 1991.

The talkative, 52-year-old Nieslanik, proprietor of a dairy and cattle ranch here on the slopes of central Colorado, works hard to put meat on America's table. He is also a beneficiary of a multimillion-dollar federal program that subsidizes grazing costs for a small corps of western ranchers.

The vast, snowy stillness of Nieslanik's rolling ranch in the valley of the Roaring Fork River seems a world away from the noisy, crowded confines of the Federal Triangle.

But there is a direct connection between this remote cattle operation and the policy-makers at the seat of government. And after their most recent encounter, the rancher with real financial problems appears to have prevailed over the cold logic of Washington's balance sheets.

Here in the Colorado high country, the biggest land owner is the federal government, and Nieslanik's cattle spend much of the year grazing on federal land. Like ranchers throughout the West, he pays the government a monthly fee for each animal living on federal turf.

For years, Washington has kept this grazing fee artificially low to help cash-poor ranchers -- $1.35 per cow per month against an average $6.87 per month for grazing rights on private land. Legislation extending the low fees came up just days after passage of the Gramm-Rudman-Hollings bill, and in the spirit of that law, Congress refused to continue subsidizing ranchers like Nieslanik.

That gave President Reagan carte blanche to set a new fee for 1986. Officials in the public land agencies say the Office of Management and Budget was pushing for an increase in federal grazing rates steep enough to bring in several hundred million dollars in additional revenue by 1991.

The budget officials rested their case on a collection of official charts and studies that portray the federal grazing program as a generous government subsidy to a small, lucky group. About 31,000 sheep and cattle ranchers in 11 western states have animals grazing on U.S. land. They represent 2 percent of the livestock industry; all other ranchers graze their animals on private land.

There is a law requiring the government to charge "fair market value" for grazing rights -- the fee private landowners charge -- but the requirement has been waived year after year.

In strict dollar terms, that waiver gives the small minority of ranchers holding public-land grazing permits a big competitive advantage over ranchers using private land -- and like most federal subsidies, this one is costly to taxpayers. A Bureau of Land Management appraiser has estimated that the government would have earned $500 million more from the grazing program over the last decade if federal grazers had paid full market value.

With all that against them, ranchers were expecting a stiff increase in their monthly payment to Uncle Sam. The articles Nieslanik read in such publications as "Western Lifestock Journal" said the fees could rise 100 percent or more.

The big stockmen's organizations like the Cattlemen's Association and the National Wool Growers started fighting back. They lined up support from an impressive group of congressional heavyweights, including the top three leaders of the Senate Republican majority.

On Dec. 13, 28 western senators -- 18 of whom had voted for Gramm-Rudman-Hollings -- wrote the president asking him to leave the grazing subsidy untouched. The letter was delivered by Reagan's close friend, Sen. Paul Laxalt (R-Nev.).

Sidestepping the official charts and statistics, the westerners argued their case in terms of people -- people like John Nieslanik, a wiry rancher whose home is a weathered brown frame house in a spectacular setting 40 miles from the ski runs at Aspen.

From his vantage point, things look different.

"The common, ordinary guy in Washington is going to say, 'How come John only pays $1.35 to the government when you have to pay $6.50 for private land?' " Nieslanik says.

"Well, there's a big difference. The cattle I graze on private land, I just lead the cows in there and the landowner worries about the fences and the trails and all that. On the federal [land], all those fences, all the improvements -- I got to pay for them myself."

Sure enough, the federal form that Nieslanik signed to obtain grazing rights on 40,000 acres in White River National Forest includes 22 paragraphs of small print listing responsibilities of the "permittee." Attached to it is a detailed list of all fences, ponds, buildings, trails and roads that Nieslanik is required to maintain on the government property.

"All our hikers, our hunters, the people who come in to get firewood -- they all benefit from the maintenance work the ranchers do," says Jack Troyer, the national forest's district ranger here.

Moreover, Nieslanik points out, his below-market grazing right is not quite the windfall it looks to be on paper.

When he bought his 800-acre ranch in 1961, he paid considerably more than the property's value because of the federal grazing permits that came with it. In economist's terms, his "windfall" was capitalized into the cost of his ranch; he has paid for it in each mortgage check.

Nieslanik pauses for a minute to listen to the deep lowing of a distant cow, then went on.

"I'm sure them fellows in Washington think, 'Well, John's getting this big subsidy, let's stick it to him, that'll help with our budget,' But I say, 'Well, I'm getting $10 less per 100 pounds for beef than I was a year ago, I'm getting $2 less for milk than three years ago. So why do you want to sock me now?' "

In the end, there was no immediate answer to that question.

Last week, OMB Director James C. Miller III sent a memo to Reagan recommending retention of the $1.35 per month grazing fee until March 1987. Miller said he hoped that a one-year freeze would keep the pressure on Congress to alter the old fee-setting formula and solve the problem permanently. A QUICK CHANGE

Here are the 18 senators who voted for the Gramm-Rudman-Hollings bill and then wrote President Reagan the next day asking him to continue the federal grazing subsidy for western ranchers: Alan K. Simpson (R-Wyo.), Robert J. Dole (R-Kan.), William L. Armstrong (R-Colo.), Ted Stevens (R-Alaska), Pete V. Domenici (R-N.M.), James Abdnor (R-S.D.), Max Baucus (D-Mont.), Jake Garn (R-Utah), Malcolm Wallop (R-Wyo.), Frank H. Murkowski (R-Alaska), James A. McClure (R-Idaho), Pete Wilson (R-Calif.), Jesse Helms (R-N.C.), Steve Symms (R-Idaho), David L. Boren (D-Okla.), Orrin G. Hatch (R-Utah), Chic Hecht (R-Nev.) and Daniel J. Evans (R-Wash.).