The pilot reported that the aircraft was landed off a normal full flap approach. The strip slopped down from the touchdown point. After lowering the nosewheel the pilot applied the brakes; however, they did not work and the aircraft's speed did not reduce. He shouted to the passengers to brace themselves and, as the end of the strip was approaching rapidly, he attempted to steer the aircraft into a fence to bring it to a stop. There was insufficient room to complete a go-around. Shortly after turning the aircraft towards the fence the brakes operated, locking the main wheels. The pilot was unable to establish any further directional control and the aircraft collided with a tree. A post accident inspection of the braking system did not disclose any reason for the brake problem.