I know that it says that the hats "get put back in their boxes on January 2nd", but do they ever come back, or are they just gone forever on the second?
They're gone. If they are ever reused in later years, you have to earn them again. The leaderboards will remain for a while after January 1st.
If you want to keep your hat on afterwards, you'd have to make a screenshot of your avatar with the hat, and reupload it.