From the question stem we can get following information,
There are 9 individuals.
They are from children, teenagers, young adults, middle-aged adults, and senior citizens.
No two individuals from the same age group are sitting next to each other.
There are more middle-aged adults than individuals of any other age group.
There are fewer teenagers than children, young adults, or middle-aged adults.
The first three individuals from the left are a young adult, a teenager, and another young adult.
The first or the last seat is occupied by a senior citizen, who is the only individual in that age group.
Now, we know that first seat is occupied by a young adult. So, last seat will be occupied by senior citizen.
Current formation,
YA-1, Teen-1, YA-2, _ , _ , _ , _ , _ , Senior-1
Now, if we are given that there are 2 YA, then number of Middle aged adults must be 3. As if they are 4, then 2 must sit together next to each other. And if there are 3 middle aged adults then only possible formation is,
YA-1, Teen-1, YA-2, MA-1 , _ , MA-2 , _ , MA-3 , Senior-1
Now, We cannot take another YA as we will be forced to increase MA too. Now, we cannot increase teenagers too as we will need to increase YA and then MA because there are fewer teenagers than children, YA and MA.
So only possible solution is 2 childrens.
Then final formation will look like,
YA-1, Teen-1, YA-2, MA-1 , Children-1 , MA-2 , Children-2 , MA-3 , Senior-1
So final answer,
Children for 5th and 7th place.