Your first sentence is correct.
They were sitting at the front
They were sitting in the classroom.
Now, when you use the word, "row", the expression is, the front, middle, last (etc) row of a classroom, theatre etc
They were sitting at the front of the classroom.
Student or Learner