In this sentence, what is the grammatical function of olyan (which follows the noun)?
Well, here it appears to follow the noun. But keep in mind that there is an unstated 'is' (van) between the 'asztal' and the 'olyan':
The word 'olyan' is a pronoun. It means such, that, that kind of, such a thing, such a one. So the Hungarian we are given here is literally: 'This table (is) such a one as that."
"the same" = "ugyanaz", it is a different meaning. 'The same' is not the same as something is just 'like' (=resembles) something.