In your examples it doesn’t matter which method you use as you can account for the measurements easily using border- box or the default content-box values.
Your examples are fixed width elements using only px for everything so the dimensions can easily be resolved to make the elements the size you wish.
If you had percentage width elements with em padding and pixel borders then the border-box value makes it easier to manage if you need elements an exact width to fit.
I prefer the border-box value as it is generally easier to manage but that is just my preference.