More than 40 years after the end of World War II, the merchant seamen who served so bravely in that conflict finally are to get the recognition that injustice so long has denied them. At last they are to be counted as veterans.

The decision has been a long time coming, but two weeks ago the Defense Department caved in. It will not appeal an order from U.S. District Judge Louis Oberdorfer granting surviving seamen the same rights and privileges that have been extended to other wartime civilian groups.

The court's order will have only limited effect, however. More than 250,000 merchant seamen served their country. It is thought that perhaps 70,000 to 80,000 of them are still alive, but they are beyond the age for such GI benefits as college tuition. A government witness conceded that the benefits now available to them will be mostly symbolic, ''really minimal.'' Most of them will get ''only a flag and a headstone'' in a military cemetery.

The merchant seamen wrote a valiant chapter in the history of warfare at sea. More than a year before Pearl Harbor, the Coast Guard began training merchant seamen in gunnery and other military subjects. In October 1941, President Roosevelt lifted the ban on arming merchant ships: they would be sailing ''on missions connected with the defense of the United States.''

With the outbreak of war, merchant seamen received additional military training. Shipping articles were changed so that seamen could be ordered ''to such ports and places in any part of the world as may be ordered by the U.S. government.'' A War Shipping Administration took over the merchant ships for service consistent with ''strategic military requirements.''

The merchantmen then set about the dangerous business of transporting Army and Navy cargoes. The great majority of 7 million soldiers went overseas on merchant ships. ''Without this support,'' said Adm. William King, ''the Navy could not have accomplished its mission.''

For all practical purposes, the merchant steamers were under the Navy's control. Military authorities assigned their places in convoys, regulated shore leave for seamen and supervised discipline for misconduct. A seaman who attempted to resign was subject to court-martial.

Tantamount to military service, theirs was a harsh service indeed. In the first three months of the war, German U-boats sank 145 merchant ships in American coastal waters, killing 600 seamen. Over the entire war, Judge Oberdorfer noted, 5,662 merchant seamen lost their lives or were declared missing in action. More than 600 seamen became prisoners of war.

Other civilian groups also served in the war effort. Not until 1977 did Congress move tangibly to recognize their service. Sen. Barry Goldwater added an amendment to the GI Improvement Act making benefits available to the WASPs (Women's Air Forces Service Pilots), and it was expanded to include other groups that had received military training and were susceptible to assignment for duty in combat zones.

Veterans' benefits were extended to 14 groups, including female telephone operators in Europe, engineer field clerks, female stenographers with the American Expeditionary Force and ''reconstruction aides and dietitians.'' The merchant seamen were repeatedly turned down, largely because of the dog-in-the-manger opposition of the regular Navy and such organizations as the American Legion. They complained that the civilian merchant seamen were paid better than enlisted sailors. In fact, as Judge Oberdorfer noted, studies found that their total remuneration ''was approximately comparable.''

President Roosevelt linked ''the beleaguered men of the merchant marine'' with our soldiers, sailors and pilots. They carried out ''a vital part in this global war.'' So they did, and if it should cost the taxpayers a few million dollars for their medical care, gravestones and flags, the money will be well spent.