If you know ahead of time that you will miss your train, try to change the ticket from the app. If this doesn't work, call Amtrak right away. If the train departs without you, your ticket will be cancelled as a no show by the next station or so (it's a manual process done by the conductor on their handheld; if the conductor forgets, unscanned tickets auto cancel after 15 minutes from actual departure I think). Cancelled tickets are forfeited. There is no process for no-show cancelled tickets unless it was cancelled in error and you're on the train.
Your 40 minute connection is doable but dicey. The EWR Airtrain is anything but reliable even when it's running normally.
Change fees are waived until the end of April.