Is a contract valid if it releases a party from liability for probable injury?
Yes, assuming that (1) the service or solicitation thereof is not outlawed, and (2) by "injury resulting from party B" you mean injury suffered by A. The contract in both of forms 1 and 2 is valid, since it meets the essential requirement that the parties know the terms/risks/etc. they willfully accept.
One important thing to keep in mind is that the parties' awareness of risk does not release party B from the covenant of good faith and fair dealing that is prerequisite (and presumed) in contract law. This means that the contract does not entitle party B to take advantage of, or unjustifiably exacerbate, the risk to which party A is subjected. In line with this, see the Restatement (Second) of Contracts at § 195(1) (stating that a contract is unenforceable if harm is caused intentionally or recklessly).
If the term "injury resulting from party B" reasonably or foreseeably implies a scenario where third parties might get injured, the contract would be unenforceable on grounds of public policy. See the Restatement at § 178. It might not be suffice that party A guarantees he will take responsibility for injuries caused by party B to others. Third parties are not partaking in the contract, whence it cannot be said that they knowingly and willfully accept the conditions therein.