Remember XULRunner that was doing Electron stuff about 6-7 years before the first version came out. Mozilla has so many good ideas and such terrible execution.
Given more resources, Mozilla absolutely could have done a better job of transitioning faster from XUL to standards-friendly equivalents, and popularizing the latter in an Electron-like framework. But there was never a time when Mozilla had excess resources floating around, and other things took priority. (Also see my comment above about how architectural churn made it unattractive to support a stable embedding API.) As was pointed out in other comments, the benefits of regular Web market share tend to outweigh the benefits of embedding popularity.
Unfortunately, there were strategic decisions to basically never maintain it :(