While both were highly trained in science and engineering, their primary roles were as pilots and astronauts, not specifically as scientists. They did conduct some scientific experiments on the moon, but their main mission was to land and return safely.
Later missions to the moon did include scientists as part of the crew, but Armstrong and Aldrin were the first humans to set foot on the lunar surface.