That's partly true, but depends on the particular program. There are Ruby programs that could be compiled ahead-of-time quite efficiently, despite their dynamic features.
The slow-path version of the code that violates runtime assumptions can still be compiled as an alternative variant - so instead of switching from fast compiled code to the interpreter, the code violating the assumptions can switch to slow-path compiled code.
And yet, we use techs from those companies on a daily basis. JVM especially. GraalVM is the next step in JVM's evolution. It's not hard to imagine that this will motivate other JVM vendors to add serious support for other languages.
Note that Nashorn is very slow - Graal.JS is orders of magnitude faster, and its peak performance is very close to V8 (although with a somewhat slower startup, currently).
That's the thing - there is no marshaling. The objects are passed between the languages as pointers under-the-hood. There is a standard way of invoking methods/functions on those pointers, that works across all languages.
The slow-path version of the code that violates runtime assumptions can still be compiled as an alternative variant - so instead of switching from fast compiled code to the interpreter, the code violating the assumptions can switch to slow-path compiled code.