Twenty people have been injured, two seriously, after a train derailed in East Sussex and a major incident was declared.