To do this, you will need a 4 year bachelors degree, which will be hard to do with a double major in both mechanical and electrical, but might be doable or may take 5 years. You'll also need 2-3 years of graduate school.
You might talk to your high school guidance counselor as well as a local Navy recruiter to find out more about your options, and what you might be able to get the Navy to pay for. Some options would include going to the Naval Academy, going into Nuclear engineering and the Navy Nuke School, looking at loan repayment options through the Navy, or going into the Navy first and then going to school after completing your service. Each of these options will have different costs and pros/cons that you will have to weigh.
Glenn S. Arche
BJ is right. You can join ROTC at college and have a free ride. Make sure that they put in writing the double major and masters degree for your commitment. Their standard set up is 4 years for a Bachelors degree. When in ROTC, you will have summer jobs in the Navy. Perfect experience for your goals
Glenn S. recommends the following next steps: