It's not an ideal situation, remembering that heat is one of the enemies of sweet-corn flavor. But how often do we have ideal situations?

Our choice would be to use the microwave method to cook the corn - wrapping each ear in a paper towel or two, moistening them, and cooking for six to fifteen minutes (depending on how many ears you fit into the oven). Keep them wrapped in the paper towels, which hold quite a bit of heat, and load them immediately and snugly into a cooler. Even after four hours, the corn should still be reasonably hot.

Another option - quite likely a better option - is the portable food warmers and travel coolers/warmers on the market, but be sure to buy one large enough to accommodate the amount of corn you're preparing.