Translation:Those who are running behind the tram are students.
"After the tram" would usually be translated with a villamos után. That definitely means following it.
A villamos mögött could mean behind the tram as in, on the other side of it (behind it from your point of view.) Actually, that's the first interpretation that came to mind for me.
Totally unnatural English translation. So many of the English translations here are too literal to the way Hungarian syntax works. A natural English translation for this would eliminate "who" which is redundant. So, I would suggest "Those are students running behind the tram."
This sentence has two clauses "Azok diákok" - "Those are students", and "akik a villamos mögött futnak" - who are running behind the tram.
In English you run into problems when you keep the first clause intact like that: "Those are students, who run behind the tram." Does the second clause refer to "students" or to "those"? That's why in English you usually insert the secondary clause right behind the object it refers to: "Those, who are running, are students."
In Hungarian, on the other hand, you have constructions like "Az..., aki", and the clause that starts with aki always refers to the object indicated by az. So you don't need to split the main clause. Maybe a bit of a stronger example here:
Az a madár repül be a várba, amelyik nagy és szép. - The bird, which is big and beautiful, flies into the castle. Here the secondary clause refers back to the bird of the main clause, because that one is indicated by az. On the contrary...
A madár repül be abba a várba, amelyik nagy és szép. - The bird flies into the castle, which is big and beautiful. Now the castle is the thing being referred to, because it is marked by az (in form of abba here).
While you have to move the secondary clause in the English sentence to get the different meanings, in Hungarian you can keep it wherever (usually at the end of the main clause), and just mark different objects with az to make the secondary clause refer to them.
And now after I explained all of that, of course you can also say "Azok, akik a villamos mögött futnak, diákok", with the same order as the English sentence, but I personally am not a fan of unnecessarily splitting clauses. The diákok looks a bit lost at the end.
You mixed main clause and dependent clause.
In the original sentence you look at the people that are running behind the tram and realise that those are students. Your sentence does it the other way around: you try to find out where students are and realise that they gathered together to run behind public transport.
Your sentence would be translated to Hungarian as "Azok futnak a villamos mögött, akik diákok."
It might help if you put down respective commas: "Those, who run behind the tram, are students" and see what is in the same clause with the "who" (or "what" or "which", whichever is appropriate). In this case it's "behind the tram". That also needs to be in the same clause with aki (or ami or amelyek, whichever is appropriate) in the Hungarian translation.
Quick question - we'd never ever say it this way in English. Is the Hungarian version of this sentence equally unusable? In other words, if I pointed to kids running after a tram and used this Hungarian sentence, would people look at me like I'm crazy? If you said the english sentence, people would move away from you in fear.
There is a significant difference: tram cannot drive without rails. Here you can see Russian trolley (on the left) and tram (on the right) side by side: https://saratov24.tv/upload/iblock/684/6847d27c29310000ffac977c97cf26b1.jpg. BTW, the Hungarian for trolley is trolibusz or just troli.
I don't understand why DL translated it once to "azok A diákok akik a villamos mögött futnak" and now mark it wrong and changed it to "Azok diákok, akik a villamos mögött futnak". That has been happening even with another sentence which later on came back in the form previously marked wrong. It's need less to be confused.