Irony is when something happens that is the opposite of what you would expect to happen. Being killed is actually exactly what you might expect to happen to someone riding helmetless (hence the existence of helmet laws), and therefore the situation isn’t ironic. It is a case of just deserts, though.
And yet *still* doesn’t qualify as irony. Irony = the lifelong rebel who never wore a helmet is persuaded to wear one in a particularly dangerous situation, and dies when he gets bitten by the venomous baby snakes living in it. The intended solution creates a worse problem.