The Last of the Really Great Whangdoodles by Julie Andrews Edwards (1974).
Why it matches your memories:
- Three children travel with a professor into a whimsical but perilous fantasy land. The chief adversary they keep running up against there is the Prock (the Whangdoodle’s gatekeeper), which can come across as an “evil ruler/prince” figure in memory.
- There’s a set piece where the kids ride a big inchworm-like creature with saddles; because of the way it moves (looping up in the middle), the middle rider bobs up to the ceiling of a tunnel and gets wedged/separated during a chase.
- There’s also a scene with glowing fungi; eating them makes a character glow and he’s taken for a ghost by underground dwellers/guards.
If this is the one you’re thinking of, it’s a great read-aloud for kids and still in print.