Yes, I renewed my US passport when I had my name changed and was able to update my gender marker as well. Nothing special is required for the gender marker, you can just choose which one you want. I recommend not using the X marker since it makes air travel difficult. I did not find it that difficult of a process, just a matter of filling out the forms and providing the required documentation. I suggest providing a copy of your court order for the name change in addition to the official copy you mail in, so they won't keep the original.
https://travel.state.gov/content/travel/en/passports/have-passport/change-correct.html