i dont really get what you meant there but i suppose those words you are asking about might be: freshman (1st-year student), somophore (2nd-year student), junior and senior (3rd- and 4th-year student respectively). hope it helps.
Tom was my junior and Mary was my senior -- This is not at all idiomatic, and would invite confusion with the definitions of junior and senior mentioned above. (Junior = third-year student, senior= fourth-year student.) The most common way I can think of to say what you want to say is "Tom was a year behind me in school, and Mary was a year ahead of me."
"Tom was a year behind me in school, and Mary was a year ahead of me."
That way is perfectly acceptable to me as a native speaker of BrE but so is the junior and senior terminology. It is not confusing to me because we don't use those terms for specific years at any stage. They can be used as comparatives at any stage in the education system, in a career or in life.