The KX's make miserable trail bikes, especially for a novice rider. An experienced rider could probably make one work, a neophyte will be very frustrated.
Difference: the KDX was designed as a enduro/trail bike, very controllable, easy to ride, not intimidating, comfortable for long hours in the saddle.
The KX was designed as a motocross bike, a competition machine. I have ridden them. They are happiest when ridden at high speed, at full throttle, on a wide open track (no trees, no roots, no rocks, no tight clutch-slipping-in-first-gear corners). The suspension is much stiffer, in keeping with the high-speed and big jumps commonly found on MX tracks.
The only similarity between the two bikes is they are both made by Kawasaki and have the same color tires. ;)
EDITED to correct spelling