Summary: Other people, including scientists, have searched for a scientific answer to your question, and come up empty. I also come up empty.
This page, by Paul Ingraham, has an extensive write up to answer your question. The page uses fairly good standards of evidence and is up front about the poor quality of the evidence. It is quite well written, but rather long. A lot of my answer is taken from his page, but I have additional pieces of evidence. Note that I have university credentials, and I can therefore read a lot of scientific studies that are behind a paywall for most people. I apologize when you cannot follow my links.
Ingraham was unable to find any published scientific research on soaking in Epsom salts. Before I found his page, I did my own google scholar search and came up empty.
This literature review paper repeated the claims of epsom salt manufacturers and stated that, "little evidenced-based research is available in the medical literature to support these claims." The review paper discusses evidence of healing effects on skin, but nothing on muscles.
This literature review concludes that magnesium cannot penetrate healthy skin.
Transport of Mg2 across skin is a critical precondition for
the function of topical, therapeutic compounds in treating
skin and inflammatory diseases. . . .
Past studies on magnesium and other metal ion permeation
through human skin demonstrated that it is not readily
absorbed under normal physiological conditions, when
the skin is intact and healthy.
In more plain english, If skin keeps the magnesium out, it cannot do anything. Healthy skin keeps the magnesium out. They go on to say that damaged skin may let some magnesium in.
The article later speculates on a way that magnesium may be able to get in through hair follicles. The authors are clear that this is just speculation.
An unpublished study says that soaking in a hot epsom salt bath leads to an increase in magnesium in the blood and urine. Ingraham speculates about how the magnesium got from the bath into the people, but does not draw any conclusions. He also calls the research methods into question.
Ingrahams conclusion matches my own, "There is no good or specific reason to believe that bathing in dissolved Epsom salts will have the slightest effect on muscle soreness or injury recovery time."