MOSCOW (AP) _ Coal miners in western Siberia, the last major holdouts in a costly, 2- month-old national strike, agreed today to return to work.

All but 12 mines in the vast Kuznetsk basin, the Soviet Union's second most important coal producing region, will resume work on Friday, said Sergei Zelenkov, the strike committee co-chairman.

Miners in the Kuznetsk basin and those at six pits on the Far East island of Sakhalin were the only miners still participating in the strike that began March 1, according to the Independent Union of Miners. Miners in the Far East region of Vorkuta earlier voted to resume work on Friday.

At its height, the strike idled one-quarter to one-third of the country's 600 mines and 300,000 of its 1.2 million miners.

Kuznetsk miners refused to resume work until they reviewed a document in which President Mikhail S. Gorbachev agreed to relinquish control over half the country's coal mines to the Russian Federation, led by Boris N. Yeltsin.

The Sakhalin miners also were holding out for proof they will be transferred to Russian jurisdiction.

Copies of the agreement were hand-delivered to the Kuznetsk miners today after they refused to consider a text dictated over the telephone from Moscow by regional strike committee chairman Vyacheslav Golikov.

Miners' representatives from 16 cities in the Kuznetsk basin voted 14-2 in favor of joining the growing return-to-work movement, Zelenkov said by telephone from Kemerevo. They represent 41 of the region's 53 mines, he said.

Miners at 12 pits in Beriozovsk and Leninska-Kuznetsk will hold separate meetings on Friday to decide whether to prolong the walkout, he said.

The agreement signed Monday transfers control of the mines from Gorbachev's central government, with its cumbersome bureaucracy, to Russia, where Yeltsin heads a more economically progressive administration.

Yeltsin has promised miners full economic independence, including the right to switch to private ownership.

Miners hope the Russian government will act on their demands for higher wages and better working conditions. Most have given up their political demands, which ranged from Gorbachev's resignation to greater-power sharing with the republics.

''The main reason we stopped (the strike) is that the men are tired and worn-out,'' said the miners' union spokesman, Boris Vasilenko.

''We are going to rise again as soon as we accumulate enough forces.''

Miners currently earn an average of $660 a month, about 40 percent above the national average. They want wages to be linked to inflation.

The official Tass news agency said strikes in the first quarter of the year cost the Soviet Union $374 million in lost production. It said most of the shortfalls occurred in March and were due to the coal strike.

Striking miners in Kazakhstan returned to work in late March after the republic's government agreed to take control of their mines.

Ukrainian miners, including those in the Donbass coal basin, the country's largest, have also suspended their strike.