A commuter train carrying around 150 people derailed outside the Spanish city of Barcelona on Tuesday, killing one person and injuring at least six, police said.