Eusociality outcompetes egalitarian and solitary strategies when resources are limited and reproduction is costly