text only appears in the last SVG element
Not in the last svg <text>
element, but in the only one. You're creating a single element and keep appending text nodes to it. Appending the same element to different parents doesn't clone it, but only move it.
You probably want to create multiple elements:
var moduleNames = ["1", "2", "3", "4", "5"];
for (var i=0; i < moduleNames.length; i++) {
var textEl = document.createElementNS(svgns, 'text'),
textNode = document.createTextNode( moduleNames[i] );
textEl.appendChild(textNode);
svgs[i].appendChild(textEl);
}