The accident involved a two-carriage diesel local service carrying 20 people from Sudbury to Marks Tey and took place shortly after 5.30 pm at the Little Cornard crossing near the village of Bures.
The driver of the tanker was arrested at the scene on suspicion of dangerous driving.
Two passengers, who had to be cut free from the wreckage, were described as being in life-threatening condition and were airlifted to Addenbrookes hospital in Cambridge and Colchester General.
Two further passengers were described as in a serious but stable condition.
A spokesman for East of England Ambulance Service said the remaining 17 passengers were "walking wounded" and all were taken to hospital in Colchester.
One child was among the injured although it was not clear last night whether the child was among the seriously injured.
A Network Rail spokesman said: “The front carriage was derailed, but remained upright.”
It is understood the train driver was trapped following the collision.
Sharon Smith, 49, who was in her front garden 200 yards away at the time of the accident, said: “I heard a massive bang. Everybody in the area ran to see what happened. At first I thought it was a car accident.
“But when I ran up the road I could see two carriages had hit a tanker.”
She said many passengers got out of the train and gathered at the sides of the road.
Ms Smith said the fire brigade was on the scene within four minutes and she stood in the road to help clear the traffic.
“There are lots of emergency services here. There are lots of sirens. They are still bringing ambulances up and down the road.
The accident involved a 44-ton tanker from a local sewage plant and is understood to have taken place on a crossing in which drivers ring the signaller to seek permission to cross the railway track.
Investigators are focusing on the actions of the tanker driver and whether he made contact with the signal box.
The accident comes against a backdrop of a safety campaign by Network Rail, which has repeatedly warned of the dangers which can be posed by level crossings if instructions are not followed.
A spokesman for the East of England Ambulance Service said “There are a total of 21 casualties of which 17 are walking wounded. The two critically injured patients who were initially trapped were airlifted to hospital and the two seriously injured passengers have also been taken for treatment.
A spokesman for Suffolk Police said the more seriously injured passengers may have suffered "potentially spinal injuries".
Two air ambulances were sent to the scene.
Last year 13 people were killed at level crossings and 14 collisions were reported between vehicles and trains.
According to Network Rail there were 145 near misses - almost three a week and a total of 3,244 incidents where individuals ignored safety instructions.