Most Amtrak trains don't stop at EWR, but NJ Transit does. I would grab a ticket on the next train due when I get to the EWR station. If your destination is downtown Philadelphia, it will take a lot longer to fly to PHL and backtrack to Philadelphia than to train it anyway. Other option is fly direct to PHL on US and cut out the mess at EWR