Do you have a brake box hooked up in the cabin? And if so is it functioning properly?
I know a lot of trailers have a fail safe that if they don't have a brake box signal and they sense movement the brakes will lock up.
If that's not the case try checking all the pins in the plug....you could be receiving a false brake lock signal....