4 team members each run 3 km, so 4 x 3 = <<4*3=12>>12 km.
Ralph runs twice as much as any team member and since team members each run 3 km, Ralph runs 2 x 3 km = <<2*3=6>>6 km.
The length of the race is 6 km run by Ralph + 12 km run by the rest of the team = <<6+12=18>>18 km.
#### 18