Why did the hydraulic disc brake stop working when riding down a steep mountain?
What you experienced was brake fade. There are two reasons why it happens: 


The fluid inside the brake boils releasing gas into the system which makes the brakes feel spongy and then non-existant.
The pad and rotor heat up sufficiently to not work, this feels like you are applying the brake but it doesn't work.


You look to have experienced the first. This is exacerbated by water in the brake line as that boils at a lower point, the DOT fluid in the Avid brakes is hygroscopic and will attract and retain water in the brake fluid. You may have also had air in the line which would have also exacerbated the problem.

The additional weight of the trailer and kids (I'd estimate an additional 100kg nearly) put more work on the brakes to keep speed low. This is the main cause of the brake fade and why you may not of experienced it before. Braking technique plays a big part although in this situation outside of your control. If you drag the brakes (long continuous periods of moderate braking) rather than short bursts you will see the brakes heat up much quicker.

In the first instance let the brakes cool to get you home. After that it would also be worth bleeding the brakes with new DOT fluid as well to purge the system of air and water. Also I wouldn't try to take that much weight downhill on a trailer.