I think it is a case of wrong usage of words / phrases rather than being ungrammatical.
If I were to pick between the two corrections, I'll go for the second one:-
近两年来,这些志愿者积极参与到各项环保活动中。
First, there is nothing wrong with 近两年来.
Second, 投入 is a completely wrong choice of words because this phrase means "investment", as in investment in stocks & shares. You don't "invest" in "environmental protection", unless the sentence includes investing some money or even time in this regard.
In the sentence however both money and time are absent, it is 活动, "activities", which you don't "invest in", but as we see below, you "participate in"
Therefore, 参与到, "to take part in" / "to participate" is appropriate.
The "中" wraps up the sentence, to indicates participation "in" some activity.