ranking function that ranks based on maximum speed between two given dates