Convert total minutes into "Hours:minute:seconds" for marathon data
Use do...end for multiline blocks. You're already doing it for the innermost block, but not the File.open block for some reason
CSV.foreach accepts a hash of options. One of them is :headers which you can set to true or :first_row. This will


skip the header row when iterating (so you can skip skip and the if..else-branching), and 
let you refer to a column by its header text instead of an opaque numerical index.



For the time-formatting you can use #divmod to get both quotient and remainder of a division in one go. Add some array destructuring, and you get this:

hours, remainder = total_seconds.divmod(60**2)
minutes, seconds = remainder.divmod(60)


Pretty clean, I think.



Alternatively, here's a hacky(!) idea. You could just treat the seconds as a regular unix timestamp, and do something like

Time.at(total_seconds).strftime("%k:%M:%S")


The assumption here is of course that no one took more than 24 hours to complete the marathon. If they did, the hour would of course roll over. It seems like an ok assumption in this particular case, but it's obviously not something that'd work for any context. It's kinda clever, but it's definitely a hack.