The fact that Batman and Superman's mothers have the same first name was always at best an amusing piece of trivia. An amusing coincidence.
And it's still a coincidence here.
Its not a strong foundation to use to have them go from "FIGHT OF THE CENTURY BATMAN WANTS TO KILL SUPERMAN" to "BATMAN AND SUPERMAN ARE NOW FRIENDS". That just doesn't work.
Nor is that the foundation that is used to have them go from Batman wanting to kill Superman to them being "friends", which is obviously not the case, but whatever, we'll entertain the hyperbole for the sake of argument.
The foundation that is used is not "My mother's name is Martha too".
The foundation used is that Batman realizes he has gone too far, an innocent (Clark's mother) is in peril and Luthor needs to be stopped.
I mean what is the takeaway? That Batman's motivations and concerns about Superman being a potential threat to humankind go out the window just because he was raised by a woman with the same name as his mom?
No. Where in the film does it even suggest this?
Batman's motivations and concerns about Superman being a potential threat to humankind "go out the window" when he sees that Superman is willing to die to protect others, and since Superman is no longer a threat at the end of the film. In other words, Batman's concerns about Superman go away and he decides he was wrong to mistrust Superman because Superman proves himself to be a true, selfless hero.
What would Batman's reaction have been if Clark's mother was named Lisa instead of Martha? Would he have still cared? Would Superman had been "humanized" in his eyes if that trivial connection wasn't there?
He doesn't care because Clark's mother is named Martha.
He cares because his trauma is triggered and he realizes how far into the darkness he has gone, and that he has almost done something terrible.
Now, Batman's trauma is certainly triggered because Clark's mother happens to be named Martha, but that is not why Batman decides to not kill Superman.
I would imagine the writers would still have made Batman react to how far over the edge he had gone and that he has wronged this other man, since that was the key point of the sequence anyway.
That is why that moment doesn't work.
Except that the word "Martha" has meaning in context. You can't arbitrarily move the goalposts and then say the moment AS IT IS WRITTEN doesn't work because it wouldn't work the same if countless other options were employed. The way they chose to go works because it's the way they chose to portray things, not because it always would have worked with countless other options.
That said, if Superman had said "mom" or "Lisa" or whatever, if the moment still contains the realization that the woman being named is Superman's mother, then the moment STILL could have worked just as well, as that could also trigger Batman's traumatic memories.