Iranians lined up at banks, grocery stores and gasoline stations today and foreign workers' families stepped up their exodus as troubled Iran approached Ashura, the big day of Moslem mourning and possibly of reckoning.

Depositors withdrew savings and housewives and drivers laid in supplies in anticipation of a possible rampage like the one last month that led Shah Mohammad Reza Pahlavi to turn to a military government in an attempt to reimpose order.

Thousands of foreigners have been leaving the country in recent weeks-along with many Iranians-in what has become a crisis atmosphere in the 29-day Shiite Moslem month of mourning called Moharram.

The government and the opposition alike are looking on Ashura, the day commemorating the death of Shiite Islam's most important martyr, as a major showdown. The day. which this year falls next Monday, marks the death in battle 1,300 years ago of Hossein, grandson of the prophet Mohammed and the leader of a revolt that led to establishment of the Shiite sect of Islam that embraces about 90 percent of Iran's 35 million inhabitants.

Such mourning days, a particular feature of Shiite Islam. often have erupted into demonstrations against the shah, shooting by the army or police and destructive mob rempages. This year Ayatollah Ruhollah Khomeini, leader of the shah's religious opposition, has predicted from exile in Paris that "torrents of blood" will flow on Ashura and called on Iranians to use the occasion to help drive the monarch from the Peacock Throne that symbolizes his absolute rule.

Ashura has become all the more important because both sides seem to be gambling heavily on the outcome and the resuling public anxiety in Tehran has become almost palpable.

Thursday, the first day of the usual Moslem weekend, marks the start of the holiday period. Friday is the Islamic sabbath and Sunday is a mourning day preceding Ashura. Sundown on Sunday marks the start of Ashura, which continues until sundown Monday.

If the nationwide public marches and sit--ins called for on Ashura by the hard-line religious leadership under Khomeini go ahead, this would bring the shah one step closer to catastrophe, some diplomats feel.

But if the opposition plans fizzle in the face of a military show of force. as government supporters hope, the shah stands a chance of slowing opposition momentum and possibly moving toward a coalition government under a "constitutional monarchy." these analysts say.

Other observers feel that if the crunch does not come on Ashura. it will merely be put off until another less predictable time.

"The government people think that if they can get through Ashura, every thing is going to be all right," one Western diplomat said. "but i think that's a hell of a dangerous assumption. There's a momentum going that doesn't depend on anybody anymore."

The major reason for the apprehension over Ashura is the statement by Khomeini that his followers should be ready to die during Moharram to defeat the shah. whom he described as "the enemy of the people." It was during Moharram in 1963 that Khomeini led an uprising that led to his exile. first in Turkey. then Iraq and now outside Paris. where he has more exposure than ever.

The calls for political agitation fall on willing ears because much of the opposition to the shah is based on resentment of his forced modernization of Iran, and because fundmentalist Moslem fervor historically mounts during Moharram ceremonies.

Ashura processions traditionally havefeatured self-flagellation with chains and whips. In former times, mourners also used to split open the skin of their heads with axes and swords.

This has since been outlawed. This year. the shah's military government also has imposed a ban on the processions in an effort to keep them from turning violent. But hard-line Shiite mullahs, or clergymen, have called for open defiance of the ban, which has helped raise expectations of a confrontation. CAPTION: Picture, Family members of Americans working in central Iran await a flight back to the United States. AP