Check to see if your water regulator valve (looks like a RAVE valve) on the water box/muffler is leaking. A leaking water regulator valve can cause your condition.
I'd check the water regulator valve for leaks before compression testing...you were riding the thing, seems fine but flatlines at 4000RPM if I understand your condition right.
You really can not test on the trailer. If it is not in the water, it will only rev to about 3000 rpm. There is a limiter to protect the engine when there is not load.