I would say that "after" and "before" are generally used with some modifier: after I arrived, before the sun rose, etc.
Afterwards and beforehand can stand on their own. "I needed to leave for the airport at 3 pm but I forgot to call the taxi beforehand." "I forgot to bring a present to her party but I gave her one afterwards."
There may be exceptions to this, but this is what comes immediately to mind.