Butyric acid contains polar OH (hydrogen bond forming fundtional group) where as Methylpropanoate is an ester where the OH group is occupied. You need to look at the polar vs non polar ratio, when the carbon chain (non polar portion) is small enough the entire molecule has a better polar ability, but as you extend the carbon chain the non-polar portion increases and this makes the solubility in water decrease. Same applies with esters, look at the polar vs non polar ratio and this is one factor which influences solubility in water.
-Josh