"Onward" is similar to "continuing forward." It means continuing, particularly after stopping for some reason.
For example, "After stopping for a quick lunch, the men got back on their horses and rode onward." (This would have the meaning that they continued toward the same place they had been going before they stopped.)
"Afterward" means that one thing has ended and another is starting.
For example, "The men stopped for a quick lunch. Afterward, they continued riding."