Definitely would help if we knew what branch you were going into, but two methods that worked pretty good for me and got my all time best to 83 in 2 minutes:
Train for the test will depend on which branch you are going into
Do as many pushups as you can in the time limit working on speed and explosiveness for the 1st set, rest 2 minutes, then repeat two more times for 3 sets going to max each time. Do this for situps too.
Then do diamond/wide pushups to failure afterward.
Or do a low rep set of about 20-30 pushups/situps numerous times throughout the day until it becomes easy then, if you started with 20, go to 25 and when that becomes easy to do multiple sets of 25 go to 30 and so on, just get the reps in and shoot for double or even triple the most you need to pass.
When we were in basic we made sure we had a certain amount of reps per day and when that got easy we increased it, also look for anything you can to do pullups on, we would do pullups in the bathroom stalls in the barracks or between the double bunks or door frames. Best of luck guy, you get what you put into it.