A task runs for a few seconds once an hour and does nothing in between. Which option is usually more cost-effective, and why?
For a job that runs briefly and is idle most of the time, Lambda's pay-per-invocation model wins — you are not paying for an idle server. Why not the others: an EC2 instance is billed for all the hours it runs, including the idle time between tasks. The costs are not equal for an intermittent workload. And Lambda can be run on a schedule, so that objection is false.