'Are training bonds legal and enforceable?'
If you have signed a contract then the answer is yes unless the contract itself is 'illegal' and contravenes aspects of national legislation.
What would be eminently arguable in court would be the amount of the bond because, as you suggest, some of the amounts levied are manifestly ridiculous and massivley overinflate the actual cost to the airline.
In the case of the UK, this is yet another matter BALPA should be, but hasn't been, invloved in.