On a small scale, yes... On a large scale, no
One day a honking long time ago my wife (who has a degree in agriculture) and I were driving by Utah's Strawberry Reservoir, which is surrounded by nothing taller than sagebrush, a lot of sagebrush... and precious little else (including grasses). I asked here how a large body of water could be surrounded by such infertile land.
I believe the details of her answer aren't valuable here. But a summary is. In the context of your question, environmentally, there's a reason the marshland is infertile and a reason the land everybody wants to live on is fertile. It has to to with bacteria and the weather and altitude and mountains and the forest development cycle and insects and animals and a whompingly high level of complexity... but the point is, there are specific reasons one area is fertile and another is not.
And if you don't address those reasons, moving the dirt will mean absolutely nothing.
Humanity can address those reasons fairly easily on a small scale, like someone's yard or garden. We bring in good soil. We water it. We fertilize it. We keep things away that will harm it. Not that big of a deal on such a small scale — and the dirt is obviously very valuable in this case and economically practical to move.
Humanity can kinda address those reasons on a medium scale. We have massive irrigation projects and massive fertilization projects, but to a lesser degree we can't keep the unwanted insects out too well (some, yes, but not most). It's a lot harder to change the environment on a medium scale and that's ignoring the cost of moving in good dirt to replace the bad dirt — which we pretty much don't do, because it costs a lot and the economics simply don't justify it.
Humanity today still cannot — to any degree — address those reasons on a large scale (see what many will consider proof that this is wrong below, it's a mixed argument). We cannot change the environment of a desert to a great enough degree that it would make any sense at all to port in a bunch of fertile loam. What you'd have, no matter what we did, was a bunch of dried out bacteria-dead dirt in a year or two. Changing the climate and ecology so drastically to so great an area is beyond our technology.
Given today's tech (2021...), yes, we could move a lot of valuable top soil anywhere we want, but it would cost a boat-load of cash and you could only move it to a somewhat less fertile region or its value would be wasted because we can't control anything more than that.
Therefore, no, what you're proposing wouldn't have value (unless that marshland isn't as infertile as you're question implies).
This doesn't mean that you couldn't use the idea to forward an important lesson. Let's take the lesson of The Aral Sea.
The Aral Sea (once the fourth largest lake on the planet) was once a famously fertile lake in Russia — until the Soviets got the idea that they could change all those climatic and ecological conditions I was talking about earlier. The soviets wanted (among other things) cotton, which was (and is...) incredibly valuable. So they diverted the two largest rivers feeding the lake to irrigate a desert to grow cotton.
That should have rung a bell (and it is the source of my example earlier in my answer). The Soviets weren't moving trainloads of dirt... all they were doing, all they were doing, was diverting water.
Now, a lot of things went wrong with that particular stunt. The canals leaked. No one cared about what would happen to the bazzillions of people who depended on the Aral Sea for everything from food to jobs. Etc. But the moral of the story is this: Today the Aral Sea is something like 10% of its original size and so salty that it's functionally a dead sea. Lives were destroyed to make way for "progress" somewhere else.
But it should be noted (and in support of your question...) that the project didn't fail so much as it had massive unintended consequences that have persisted for the better part of a century. Cotton is still grown today and still a valuable crop.
So... (let's call this a conclusion to my conclusion)...
Could you do it? Sure, at great cost. Would it work? Well, maybe... kinda... yes, in a way. Would it be believable if you didn't bring the negatives into it?
And that's my point. The answer to that last question is no. People live and thrive on fertile farm country for a reason (yup, another ecological reason) and comparatively don't live in deserts for a reason (let's leave Arizona out of this!). And if you try to make one into the other, it's going to have consequences equal to or greater than the benefits.
And that's the lesson of the Aral Sea.
For every action there is an equal and opposite reaction... Mess with the balance of nature at your own risk.