Shrink length of final bar

Select the rest on the 3rd beat of your final measure and double click the Final Barline from the Bars and Barlines Menu in Write Mode.
You might need to Write → Trim Flow afterwards to get rid of empty measures.