If you have the choice, 457b has more flexibility and no downsides, so I would do that. In fact, I wish I had done that earlier. I have worked govt for a long time and built up a large 401k when I was younger before realizing I could have been doing 457b. I have the option of retiring at 53, so that choice may delay me to 55 now as I may not be able to catch up my 457b in time. (I know, cry me a river....

)
Either way, a short time contributing to one or the other is not going to make much difference in the long term, so nothing to beat yourself up over.
If you don't think you will retire before age 55, then it doesn't matter too much. You can use Rule of 55 with 401k if you retire between 55-59.5. SO the main advantage is if you plan to retire really early, as you can withdraw 457b at any time after you leave the agency sponsoring it.