The larger military academies provided the cadets a degree in engineering. Most smaller military academies and military schools offered an engineering degree with other degrees available. This is the reason so many academies wore an engineer style castles as an insignia.
The photo does appear to show a young man or perhaps a teen. My best guess is that he is a cadet, but I can not rule out him being a militiaman or even a member of a band. Castle insignia were common for cadets, less common for militiamen, and I would thing uncommon for band members. Some states did have a few engineer companies.
The photo in post #1 is a head and chest image and sadly does not provide too many details of the uniform being worn. There does appear to be epaulets on the shoulder, perhaps cloth should boards type epaulets. Epaulets were not overly common on cadet uniforms. We also have the braiding on the breast as a cue. I think the cap is interesting and not a cap I can place. Elizygreen died not say what state her ancestor grew up in and perhaps this might help come up with a guess on what military academy her ancestor might have gone to, if indeed he did get a degree in engineering from a military academy.