HOUSTON, Oct. 15— Heavy rains that have drenched Texas over the last few weeks are beginning to bring a merciful end to the worst drought in a generation.

The improvement has been marked in nearly all parts of the state, as well as in New Mexico and northern Mexico, although it has not been uniform. Corpus Christi and parts of South Texas still need more rain.

But in East Texas, in Central Texas and in the badly stricken ranch country of West Texas, where cattle had been reduced to eating cactus, the rains have brought rare green to the parched range, though it is too late to grow much more grass this year.

''The drought is no longer a serious problem in West Texas,'' said George W. Bomar, a meteorologist with the state Department of Water Resources. He added that over all, the rains had brought ''notable'' improvement, though some regions of the state still suffered from ''moderate'' or ''mild'' drought. Estimates of Loss

The drought has been going on for two years in some areas, one year in others. The state Agriculture Department has estimated that the drought has cost the state's agricultural industry $1 billion in the last year alone. Cotton has been particularly badly hurt.

As a result of the rains, 26 of the 90 cities and towns in Texas that had imposed mandatory or voluntary water- use restrictions have lifted them, according to Jack Stearman, hydrologist with the Texas Department of Water Resources. He said restrictions had been eased in 10 of the 30 cities that still had mandatory controls. ''If October will continue to provide more rain, this will improve considerably,'' he said.

His pronouncement comes after a weekend of staggering downpours in much of southeastern, south-central and north-central Texas. Downtown Houston got 3.37 inches in two days, and Freeport on the Gulf got 5.58 inches. Austin, the capital, has had seven inches in the last week, including some ''gulley washers'' that caused severe flooding in parts of town last Wednesday.

Meanwhile, in Albuquerque, where it was raining heavily today, J. C. Schwartzman, executive director of the New Mexico Livestock Agency, pronounced the drought over in his state. It Is Termed Insidious

There is perhaps no natural calamity more ominous than drought in Texas, a state heavily dependent on cotton, rice and citrus crops, as well as cattle, sheep and goat ranching. In his recent book, ''Texas Weather,'' Mr. Bowmar, the state meteorologist, described it this way:

''Drought is unlike any other type of weather phenomenon in that it is distinctly insidious. It creeps upon us slowly and gradually, leaving us to discover almost abruptly its terrible reality. It leaves its victims debilitated and frustrated, for as much as any other aspect of nature's behavior, it rudely demonstrates our utter helplessness in its presence.

''Day upon day, with the last dash of rain a distant memory, we peer into a sun-splashed sky, knowing full well that it holds tons of invisible water vapor that are more than ample for our needs. We gaze upon pastureland so badly scorched as to be no longer edible for livestock, stock tanks and reservoirs whose levels sag lower with each passing day, and acres of crops that wither and wilt into oblivion.''

That has been the story for much of Texas for the last two years as it has suffered through the worst dry spell since the catastrophic drought that peaked in 1956. Just as with that earlier drought, or ''drouth,'' as they call it here, this one appears to be ending abruptly with heavy rains generated by summer-end tropical storms. A Pacific storm brought heavy thunderstorms to West Texas and New Mexico last month. Floods in Rio Grande Valley

Extremely heavy rains recently brought more relief than they wanted in the agriculture-rich lower Rio Grande Valley, which suffered severe floods. There has also been substantial moisture in the hill country and Central Texas, in the southern and high plains. But water is still lacking in the so- called ''winter garden'' region in South Texas stretching from Del Rio to San Antonio and Corpus Christi, and in the the Panhandle in the north.

Despite the improvements, the state Agriculture Commissioner, Jim Hightower, has not dropped his request for a waiver of Federal regulations to help ranchers feed their herds. He has asked Secretary of Agriculture John R. Block to permit farmers who grow hay under the so-called ''set aside'' price- support program be allowed to sell the crop to ranchers. Under present rules, which the Reagan Administration has refused to relax, the farmers can use the hay only to feed their own animals and much of it has gone unharvested.

The surplus hay is still needed, said Doug Zabel, a spokesman for Mr. Hightower, because with winter coming, not enough natural vegetation can be expected until next spring even if it continues to rain. Even in good years, cattle feed on range grass only until December, and then are kept on hay for three months.

But most Texans need water not for cattle but for lawns. In Austin, lawn- watering restrictions that placed residents on a five-day watering cycle, under penalty of a $200 fine, ended on Sept. 30, as they usually do at summer's end. Still, said Michael Erdmann, manager of consumer services for the city's Water and Wastewater Utility, rainfall is running about eight inches below normal and the lakes that feed the city are still 20 to 40 feet below normal. Austin actually has an adequate water supply, but not enough pipes to fill the needs of the fast-growing city in dry years when everybody waters lawns in the evening.

By drought's very nature, it is difficult to determine when it starts or ends. But all Texans, from flinty West Texas ranchers to East Texas rice farmers, are hoping it's over for now.

photo of storm