Do you intend to transfer your ticket to another person?
Officially you're not allowed to correct or change your sex in the booked ticket.
But you can visit CRS(Chief Reservation Supervisor)/Station master etc with your id proofs and they can verify your credentials and put official stamp on your ticket about "sex verified" - then it'll be accepted by the TTE's.
If you have not got age corrected then request the TTE to consider this and allow you to travel. Some TTE's will accept and allow you to travel.
Even if you're considered without ticket due to sex issue, you'll be issued a new ticket and you'll need to pay ticket fare in full again but you'll be allowed to keep your berth and it'll not be passed to other passengers( RAC or Wait-listed).
→Always be humble & talk in soft tone with TTE when requesting to consider such issues in favor of you.
CRS( Chief Reservation Clerk) do have some discretionary powers and they can change it for you. But only if you go through some channel who knows CRS( relative, Railway employee or even a VIP link). Don't forget to carry your id & age proof in that case.