A Stochastic Decision Process Model for Optimization of Railway and Tramway Track Maintenance by means of Image Processing Technique