A prenuptial relating to alimony is likely to withstand a challenge in court if there isn't fraud involved and both parties have their own lawyer. However, nothing can be guaranteed.
The court looks to the best interest of the child to determine custody. A parent who has signed his/her rights away in a prenup can still successfully challenge the agreement.