There's a problem, though: it doesn't work that way.
The size reported by Windows is (if I'm not mistaken) the committed heap size of the program. Unless the application actively surrenders allocated pages back to the OS (and hint: no application does that), that memory is committed.
Edit: to add some color: when a program calls malloc, memory is allocated from pools inside the process itself. If no memory is available in the internal pool the allocator will call out to the OS for additional pages (in the Unix world this is a call to sbrk). When free is called, memory is returned to the internal pool but is not surrendered back to the OS and thus remains committed to the process. Actually reducing the committed heap size once again requires an explicit call to the OS (e.g sbrk).
Of course it may be swapped out by the OS, but that just means slow disk I/O when that application comes to the foreground or accesses those swapped pages (which presumably contains the precious cached data you refer to).
Should the OS use memory to cache transient data? Certainly. OSes typically contain logic to throw away those caches if memory is needed.
But applications that do this without intelligently surrendering cached pages back to the OS when memory is low (as an OS does with its own caches) just put that much more memory pressure on the overall system itself. And I've never heard of an application that does this. Certainly I've seen no evidence that Electron is that sophisticated in its memory management, though I'm happy to be proven wrong.