Janet Greaves from Durham was dismissed from her job as a clerk at Kwik Save Stores after she returned to work to deliver a sick note.
Heather Crees from Essex was sacked by the Royal London Mutual Insurance Society when she sent a written notice saying she was unable to go back because of illness.
Both companies claimed that the women had automatically terminated their contracts because they had not complied with the terms of the Employment Rights Act, and been ready for work on the first day after their maternity leave.
But Lord Justice Mummery, giving the ruling, said the women had been unfairly dismissed.
In the case of Mrs Greaves, the industrial tribunal reached the correct decision and the Employment Appeal Tribunal should have dismissed the appeal by Kwik Save, he said.
The judge said an industrial tribunal had erred in law in the case of Mrs Crees when it found for the insurance company.
Laura Cox QC, who represented both women at the hearing last month, said the test cases were important for all women trying to combine work with parenthood.
The cases could open the doors for thousands of other women to take similar actions.
Equal Opportunities Commission
The BBC is not responsible for the content of external internet sites.
Authors revolt over book ban
Thousands expected for countryside march
Ticket rush for Diana concert
Final call for gun owners
Rural schools saved by the bell
Queen backs historic change to who may rule
Finally gone - Windsors auction raises £14m
Outspoken army major faces sack
Paratrooper's murder conviction quashed
Neville goal strengthens United's lead
(From Sport)
Oxbridge escapes cuts in grants
Last chance to spend old 50ps
Ban on media cash for witnesses
No ticket, don't travel - Straw
(From Sport)
Clapton helps to 'kick them blues'
Government reassurance on MMR vaccine
North battered by gales
Unionists issue talks warning
British journalist "unlawfully killed" in Chile
England's past looks into future
(From Sci/Tech)
Regions get bigger share of Millennium millions
Rural anger goes to town
Silver Seraph rolls into limelight
(From Business)