Unfortunately, Mermaid can’t render to SVG without a full browser rendering engine. This was my biggest complaint about Mermaid.
There is a command line tool, but it downloads a browser renderer.
Hopefully someone will let me know if this has changed since I looked :)